Nodejs is a toy.


The world is async. Thus programming has to be async too. Actually, Moore's Law is a lie, you don't have to wait for more power, you just have to wait less. But Async programming is hard because you write linear text wich is translated to async actions. Async is a new world and the old one is not able to evolve from sync to async.

Threads are rough tools, like assembly. Languages can use it, but you should not, really.

Python gevent, Ruby Event-Machine are geneticaly modified chimeras. You are born async or not. Erlang, scala, golang, nodejs, all of them are born async, try them and feel the difference.

Async programming will be your new sport

Nodejs is the world best language to learn async programming, period. No one can beat javascript.

It is a functional language, its syntax is just universal. Javascript learning curve is one of the flatest. And no one can avoid javascript, client side, server side, in your database, it's everywhere. Moreoever, efforts to make javascript fast has no equivalence. Even the JVM gets less love from Mozilla, Google, Apple and Microsoft.

Javascript use just two tools to handle async: events and callback. Python is condemned to stay in the old world with its lack of anonymous functions and anyway, you can't mix sync and async tools. Javascript documentation is concise, weirds parts are not weird but exotic historical stuff. Spaghetti callback is just a sport for optimizing your brain. Nodejs fundations are good (libuv, V8), without batteries included, but users provide these in a very short time. Nodejs is the best tool to build async client/server prototypes.

Yeah, just prototypes.

Because nodejs is a toy.

Hell is other people

Regularly, nodejs breaks its API. I saw the drama when 0.4 became 0.6 and now 0.8. Your own code is easy to upgrade. Not the library you depend on. Npm (the package manager) is full of half baked libraries. Sometime, angry developers fork, fix and pull request abandoned libraries. You can wait years for a merge. Nobody cares. Everything is just prototypes or toys. However, you can trust the work of Substack, Astro, VisionMedia or Joyent. Because they work with nodejs, they are not prototyping. I would trust the package manager. When I want to play with msgPack, I just want to type "npm install msgpack" and not googling to find the right fork.

Nodejs is not yet 1.0 version, so it's ok to upgrade MY code when major versions come: nobody wants to live the drama of Python 2 to 3, right? An API is only engraved when it is stable and coherent. Release early, engrave later. But I don't want to be trapped with an old version of node and bother my Debian admin with a specific version. I don't want to lie to him when he ask me where is the STABLE version of nodejs.

So remember, don't try to work with nodejs. Play and prototype as much as you want but when it comes to real life problem solving, use real languages like Erlang, scala or even golang. It's a pity, and Crockford and Ryah will be sad about this.

Partager cet article :