
Paving the way for the new Node.js - neumino
http://blog.justonepixel.com/geek/2014/01/27/paving-the-way-for-the-new-nodejs/
======
bilalq
A pity the title doesn't mention rethinkdb at all. A new driver with generator
support is very exciting news.

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...](http://blogs.atlassian.com/2013/11/harmony-generators-and-promises-for-
node-js-async-fun-and-profit/)

------
NathanKP
I've come to be a big fan of async.auto which allows me to break a large task
down into smaller functional steps, define their required dependencies on each
other, and then just let async take care of the magic of executing the
operations in the correct order, and parallelizing operations when possible.

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.

~~~
camus2
Yet you still need to write callbacks.Neither async nor promises nor
generators solve that issue.Afaik only fibers make the code lighter. ES6,
arrow functions will make things less painfull though.

~~~
eknkc
Generators actually solve the callback issue:
[https://github.com/visionmedia/co](https://github.com/visionmedia/co)

------
hippipp
In the event that you find yourself wondering how these newfangled generators
(used by the rethinkdash driver) work, see the following:

[http://blog.carbonfive.com/2013/12/01/hanging-up-on-
callback...](http://blog.carbonfive.com/2013/12/01/hanging-up-on-callbacks-
generators-in-ecmascript-6/)

------
orf
For anyone using Python who likes the look of this Twisted supports exactly
this using their (rather awesome) inlineCallbacks decorator.

~~~
sdegutis
I had a really, really hard time using Twisted every single time I tried, over
the last 5 years. It's a very opinionated framework that requires you to
structure your code and business logic in a very specific way.

I'd love to see alternatives to Twisted that are built as a library rather
than a framework.

~~~
msolujic
check out tulip

------
sdegutis
Serious question: What is the benefit of Node.js over other server-side
platforms? Is it just because client-side developers are already familiar with
JavaScript?

~~~
rubiquity
I have a very different view point than most about why I think Node.js is
popular. Take it for what it's worth.

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.

~~~
Renaud
I'm curious as to what sort of things you are building with Node.js in the
context of systems programming.

------
heydenberk
>> Now look how wonderful the code looks with new driver.

Yikes. That is not so wonderful looking. But yeah, it's better than callback
hell.

