Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To answer your (possible rhetorical) question literally, the requirement here isn’t that it generate Fibonacci numbers efficiently, it’s that it implement the recursive algorithm efficiently.

It’s true that another algorithm will be much faster, but that deprives us of the opportunity to discuss how this implementation of the recursive algorithm delivers much higher performance than a naïve implementation.

The back story is that an abrasive blog post asserted that Node.js was a terrible platform for certain types of problems, and this algorithm was given as an example. The author here is simply showing that with care, Node.js will not be the problem.

For shits and giggles, here’s another Fib algorithm, chosen strictly for the pleasure of implementing it:

https://github.com/raganwald/homoiconic/blob/master/2008-12-...



The specific point is that the evented model is not designed as a "one size fits all" solution. It's great for certain scenarios, not very good for certain others.

Basically, the original blog post tries to get to this, remarking on node.js is sold as if it was the silver bullet of web servers, that will scale to anything for anything you .

Of course, you can try to adapt most problems into something that would work in an evented model, but you have to know VERY WELL what you're doing.

IMO the solution is simple: polyglotism. Have parts of your app in node. Other parts in python. Others in ruby. Whatever works best for each specific small part :)

Node is not useless, but it's definitely not my choice to program everything and anything. Same thing with, for example, Rails :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: