Live data from Hacker News

A response to Node.js is cancer - The Diagnosis

joshuakehn.com

41–50 of 57 posts

Re: A response to Node.js is cancer - The Diagnosis

#41
post #6

I like node.js, but this post completely misunderstands "Node.js is Cancer". The point of that post isn't that node.js is slow; its point is that node.js does concurrency, but not parallelism; i.e., if your code is CPU-bound, it can only serve one request at a time.

Exactly. This is not about performance, it's about parallelism.

Re: A response to Node.js is cancer - The Diagnosis

#42

Earlier quoted context omitted.

The platform does it: other requests are handled by other threads or processes (pooled or not), one request is going to consume 500ms and the rest will keep on trucking concurrently. Unless you've gone above the capacities of the machine itself, other requests will be little to not affected.

would you mind giving an example of how you would code it so that that 1 request didn't block the rest? in a browser I'd go with a setTimeout or setInterval hack to "fork" another thread. is this the same in node?

In Node Web Development [Packt], the author uses a Fibonacci algorithm as an example that could block the event loop.

It outlines one solution where the calculation is split into callbacks dispatched through the event loop, making use of process.nextTick()

Re: A response to Node.js is cancer - The Diagnosis

#43
This response misses the point, which is just that it's trivial to show that you can write blocking code in node. Any program that does significant computation will still block and pause all network IO (without setting up side processes, etc.). "The stupid fibonacci benchmark" is just a cliche way to chew up the CPU.

My main beef with node.js is the hype, to be honest. Many of the people who are really excited about it seem completely unaware that this kind of thing is hardly new. Tcl has been based around an event-loop for ages! Erlang was made in the mid-80s, and has a very mature (and thoroughly integrated) event-loop-based architecture. Also, its focus is on fault-tolerance / error handling in a multi-node system. I don't know what progress Node.js has made there, so far.

Re: A response to Node.js is cancer - The Diagnosis

#44

To be honest, most of his blog posts seem to be inflammatory in nature with a cute picture at the top. I wouldn't be surprised if Ted wrote it merely to get blog views.

I put Ted squarely in the category of "contrarian" rather than troll. I think it's important to have people calling out the Emperor for having no clothes, even if the Emperor is wearing clothes. It makes for debate, which in turn makes for reasoned decision making.

Re: A response to Node.js is cancer - The Diagnosis

#48

This response misses the point, which is just that it's trivial to show that you can write blocking code in node. Any program that does significant computation will still block and pause all network IO (without setting up side processes, etc.). "The stupid fibonacci benchmark" is just a cliche way to chew up the CPU. My main beef with node.js is the hype, to be honest. Many of the people who are really excited about…

Heh, wasn't VB5/6 also event-driven?

Re: A response to Node.js is cancer - The Diagnosis

#49
post #48

This response misses the point, which is just that it's trivial to show that you can write blocking code in node. Any program that does significant computation will still block and pause all network IO (without setting up side processes, etc.). "The stupid fibonacci benchmark" is just a cliche way to chew up the CPU. My main beef with node.js is the hype, to be honest. Many of the people who are really excited about…

Heh, wasn't VB5/6 also event-driven?

I'm not familiar with it, but that would make sense. GUI systems are often built around event loops.

Re: A response to Node.js is cancer - The Diagnosis

#50

This response misses the point, which is just that it's trivial to show that you can write blocking code in node. Any program that does significant computation will still block and pause all network IO (without setting up side processes, etc.). "The stupid fibonacci benchmark" is just a cliche way to chew up the CPU. My main beef with node.js is the hype, to be honest. Many of the people who are really excited about…

Virtually every request made to the server is blocking. The point of a server request is to retrieve/store data, process it, and respond. That's a blocking operation by definition. I can't respond before processing the data. I can't process it before retrieving it. You get the picture.

The neat thing about node.js isn't that it's "non-blocking" ... every major HTTP server out there is "non-blocking" in the same way. The neat thing is that it's JavaScript. I can use the same language on the server side as on the client side. I can use the same libraries, etc. reducing my code footprint. Reduced code footprint = less maintenance, fewer bugs, easier coding.

Post reply on HN