Hacker News new | ask | show | jobs
by j0ev 4765 days ago
1. node.js happened

2. lots of devs already know the javascript API very well.. a lot of times these same devs write server backends. why not share code between client and server?

3. (maybe just me) it turns out writing in a language as dynamic and flexible as javascript is pretty fun

1 comments

1. I guess why did node.js happen. Was the developer just trying to showcase his skills and did it for fun, and then went viral. And now everybody else is just doing that. To me then *.js are nothing more than a fad. 2. Reasonable. 3. Php is fun, has more support (atleast when it comes to doing more 'servery' stuff.
I'm not an expert on Node.js but my understanding is that Ryan Dahl wasn't happy with the performance that PHP and Apache provide. PHP is very feature complete but the way Apache handles web requests means that a web server has a relatively low max capacity. Apache handles requests by forking the process which is both slow and resource intensive.

The way Ryan explained it is that moving past that performance barrier is a solved by a single threaded application that can respond to event based input output. He liked Javascript because it is such a minimal language which already supports that paradigm and has advanced tools and community.

That's the main point that I recall from one of the talks of his that I watched. There are some tertiary reasons as well which make Javascript a good choice.

No, node.js needed to happen. Javascript makes it very easy to write event-driven code, which it turns out is a pretty good model for a web server, especially if you are routing real-time data between clients. It didn't just "go viral", it had solid proven performance stats.

Don't get me wrong, I started with PHP and it is solid, but yech I wouldn't call it fun.