Re:Ask HN: Experienced C programmer, new to web, which langu...
by architgupta on Monday April 25, 2011 @03:53AM
(#2480754)
Why is this downvoted?
Re:Ask HN: Experienced C programmer, new to web, which langu...
by hasenj on Monday April 25, 2011 @07:46AM
(#2480993)
I'd like to know the same
Re:Ask HN: Experienced C programmer, new to web, which langu...
by architgupta on Tuesday April 26, 2011 @02:05PM
(#2486426)
Nevertheless, your views on Node.js has made me very curious and I will investigate.
I have another question - I'll google if you don't get a chance to answer - how do rails and node.js play together? (real world experience)
Though that alone doesn't say much. I recommend first of all you write the code in coffee-script and not in javascript.
Node is bare-bones and the choice of template languages and what not is left up to you. I recommend stylus for css, and jade for html templates.
For databases I recommend MongoDB (or some other nosql type database). There's a Node module called 'mongoose'; it seems decent but I haven't used it so can't say much.
MongoDB uses flexible documents (json objects) instead of sql-type tables, and allows you to add/remove fields dynamically to individual objects ("records") without having to redefine a "schema". So at least in theory it should make migrations a lot easier.
Why do I recommend Node instead of Django or Rails? Simple: I think it's the future. Node.js is very lite, has an awesome package manager, lively vibrant community, solves the concurrency problem beautifully, it's evolving rapidly, but more importantly: it makes simple things simple.
Ever saw a comparison of a "hello world" in Java vs. Python? Java requires you to do a lot of setup upfront, where as python just lets you say:
Well, Node is kinda like that.Creating a project in Django and/or Rails requires a lot of boilerplate. Where as in NodeJS it's a single .js file with about 5 lines of code. And sure, Django/Rails have tools to automate the creation of this boilerplate, but it's still a clutter to your environment.
(For the record: there is a lite framework for python called Flask, but it lacks all the other benefits of Node)