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

I understand node is quite good at those scenarios but is there any real advantage over say Ruby/EventMachine or Python/Twisted or if you're serious about it scaling, Erlang/OTP? Evented systems are great for those scenarios but I can't work out if there's some secret sauce in Node I'm missing or whether there's a lot of excitement from people that don't realise there are mature solutions to those scenarios in other languages.


If anything Node is much more limited than the alternatives, both because of the language it uses, and because of limitations of the implementation, which basically (rather ugly hacks aside) doesn't scale at all beyond one core, and if any of your code turns out to be CPU bound, your performance goes right out of the window.

Go and Erlang are much better both in the concurrency models they provide and in their performance and scalability. Not to mention they are real languages carefully designed over many years by talented language designers, not the result of unfortunate accidents of history hacked up in two weeks like JavaScript.


Node has multi-core via message passing. Erlang has... multi-core via message passing. Now there are other differences in their concurrency models, but they're not worlds apart, and the idea at node does not scale beyond one core is false (see the Cluster module).


There are a number of reasons. I work on one of the larger node apps out there, and its working great for us (admittedly, we use CoffeeScript, which eliminates half of the arguments made against node).

- Server/client sharing. This sounds like its not a big deal, but it is if you're writing an app for which node is a good choice. Our code is close to 50/50 client/server (maybe a little server-heavy), and the amount of shared code is fairly surprising. - Native JSON. All of the data that we send from our servers is JSON (with a few exceptions for errors). Mongo speaks JSON as well. Its extremely useful that all of our data is in the same format, including that going over the wire and that inside our code. - One language. I've used server-side Python before, and it is way easier to only have to think in one language, especially if you jump between server and client code often. - CPS. Everyone's hating on it, but its hard to see the advantages of it without working on a large project first. I was very skeptical when I started, but it really works well. Most people are immediately turned off by the amount of nesting involved, but a simple async library resolves this nicely. - Javascript. It has problems, but most of them are ways to shoot yourself. If you avoid shooting yourself, it really is a beautiful language.

The biggest problem with node is that the average programmer* probably can't grok CPS. Its honestly a lot harder than most code you'll see. That said, I can't imagine the codebase that I work with being less than an order of magnitude larger without it, so its well worth it.

*In my experience, the average programmer can't grok recursion or pointers, either.


luriel wrote a nice answer, like a good, old hater would write. (You can't just go around and insult programming languages. They have feelings too, dude.)

is there any real advantage over I think that's the wrong way to choose a platform. Are you good in Ruby? Then use RoR. Are you good in JS? Then use node.js. Maybe RoR is a much better platform than node.js, maybe it's not. But I finished writing my framework/application 10 times, before you even typed RoR. :D Furthermore: You. Don't. Use. node.js. For. CPU heavy. tasks! Don't do it. For everything else I think it's a wonderful framework, if you want to write something I/O heavy.

btw: The strict asynchronous programming style, using JSs closures, is pretty much the same thing you would write in C (except for that you don't have closures). I recommend everyone to look at least once into https://github.com/joyent/libuv/ But unfortunately many "programmers" here won't do it, since C is stupid and for old farts. I mean: I can do anything in C# in a tenth of the time compared to you with C (http://programmers.stackexchange.com/q/164017)


> But I finished writing my framework/application 10 times, before you even typed RoR.

You are never 'finished' writing, code requires almost perpetual maintenance and improvement. (Unless the project is a total failure or you are DJB.)

I'm sorry, but if you are only good in JS, or PHP, the very first thing you should do is become good with some better tools.

Yes, it is possible to write working code in any language and platform, but languages and platform still matter and have a cost you will pay during the lifetime of your application, in security, reliability, scalability and maintainability.


Please don't just grab some random words from my post. I'm pretty sure you know that the sentence in question was just an idiom. And just so you know: I have experience in, and still regularly use C/C++, C#, Java, Haskell, Ruby, Python, Javascript, PHP. I don't know what node.js did to you (maybe you tried something as writing a whole webframework with node.js? or something as foolish as a file server?), but you should know that there are many projects out there which use node.js where it fits and it's running good (prime examples are Microsoft and LinkedIn).

> I'm sorry, but if you are only good in JS, or PHP, the very first thing you should do is become good with some better tools.

And I don't know what the hell is wrong with you, that you assume that you are the wisest of all men and know what is wrong with everything and what to use in any situation and what I know and what I do and what I should do...

> and have a cost you will pay during the lifetime of your application, in security, reliability, scalability and maintainability.

So thanks for this lesson. I swear I will spread the word, but before I will go and worship JS/PHP, as the little, stupid fanboy I am. (fyi that's called the language of sarcasm)

As I said: Don't go around and "insult" programming languages, because most of them have their right to exist and nobody forces you to use something you don't like, nor anybody else. Most programmer choose to use node.js and if they fail it's not necessarily the fault of the "tool" (though it can be), but also the fault of the programmer in question, by choosing a "tool" which didn't fit. I mean: You wouldn't try to put a screw in the wall with a hammer. Am I right?


> Are you good in Ruby? Then use RoR. Are you good in JS? Then use node.js.

Unless you're talking about getting a working prototype up-and-running, I could not disagree with this more. Classic "all I have is a hammer so everything looks like a nail" sentiment. Make your tool choice based on the problem you're solving.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: