Paving the way for the new Node.js
blog.justonepixel.com
blog.justonepixel.com
By the way, for those that are interested, here's a link you can use to learn/understand how generators can help with async control flow: http://blogs.atlassian.com/2013/11/harmony-generators-and-pr...
Do any of you promise and/or generator users know of a good equivalent to async.auto?
I feel like promises and generators have potential but much of my code is based on async.auto and I feel like it would be complicated and painful to try to rewrite that with promises and generators.
http://blog.carbonfive.com/2013/12/01/hanging-up-on-callback...
I'd love to see alternatives to Twisted that are built as a library rather than a framework.
Share code for server and client (HTML5) side.
But there are other benefits, those are depending on what you compare it against.
TypeScript also works well with Node.js if you want something more strongly typed (and with classes) on the server side and still have the advantages that Node brings.
The things I like about it are NPM, which is the package manager and is quite handy--maybe a bit better than bundler for what it does.
Writing extensions in C/C++ is not hard to do.
Extending node with your own Javascript code and bundling that as a library for others is not hard at all (see NPM).
It actually runs on Windows with a minimum of wailing and gnashing of teeth.
You can do remote debugging of a server with some sanity.
It plays with messaging libraries (zmq, sockjs, etc.) very well.
Grunt is awesome for running tests and not being makefiles.
There is a pretty cool LDAP client/server library available for it.
~
That said, there are some things that bug me.
Javascript has some nasty edges, and anything you don't like about Javascript won't go away with node.
Async callback spaghetti hell will happen unless you use something like promises via Q, and it will suck.
It's a young platform, and nobody quite seems to have Rails or CodeIgniter or whatever for Node yet--too many contenders currently.
There is no standard ORM yet, and has the same issues as above: many choices, no winners.
Node devs can be derpy sometimes (usually around threading, fibers, rediscovering basic principles of operating systems engineering, etc.) It's a loveable derpiness though.
Express (a pretty standard Sinatra-like web server for node) can die in a fire: its docs are bad and the devs should feel bad (and it's soon to be abandoned, it looks like, as there is yet another new shiny incarnation of it on the way.).
~
It is quite good at prototyping at hackathons, though.
True, but other async platforms lack a developed ecosystem of add-ons written to be asynchronous.
I've always sort of laughed at the idea of Front-End developers flocking to Node.js just for the fact that it is the same language. I actually really like Node.js but hardly ever use it for web apps. I think where it shines is as a platform for systems programming and I think when you look at Node.js systems programming was clearly at the forefront of the design.
I can't count how many Front-End-to-Node.js developers I've worked with that have been using Node for a year or more and have no clue about processes, sockets, streams and pipes. Perhaps that is a testament to libraries like Express that hide all of that, but in my opinion the beauty of Node.js is all of that "other stuff" Front-End people ignore. To each their own I guess.
Also, the myth of sharing Server and Client code is almost never done and even when it is, it isn't done well.
Node.js isn't a web framework so it doesn't compete with Django, Rails, ASP.Net, PHP etc. I generally consider it a tool for building web services, which it's great at.
For example: I've got Node.js servers which host JSON APIs calling Postgres stored procs on a Django app because it's faster than going through Django when you've worked out the interfaces.
That, and probably the breakneck pace at which it forces you to embrace asynchronous operations. As async, parallelism, and concurrency become more important, I think it's valuable to start thinking in these terms as fast as possible.
Yikes. That is not so wonderful looking. But yeah, it's better than callback hell.