Node.js?



  • I got asked about node.js at a job interview, and I gave my honest opinion which was this: when I looked into it 3-4 years ago, it seemed like 90% hype 10% meat, and I didn't understand exactly how (technically) it could possibly be faster than a traditional web server, even in theory. The guy looked at me like I kicked his dog, then gave me some stuff he'd memorized from a trade conference about how some ad server was using node.js and as a result they were the "fastest ad server", to which I pointed out, "that could mean node.js is faster, it could mean they have more servers, it could mean they have more geographically-distributed servers, it could mean they have fewer features than their competitors, or it could mean they have no idea how to benchmark properly."

    So anyway. Who's using node.js? Is it worth the learning curve? Are there any good dev tools for the thing, or is it all Coda on OS X and deal with it? Is it more meat or more hype, now that it's matured by a few years?



  • My site loads in 5ms!

    No it doesn't! It takes 4000ms just for the HTML!

    I tested it myself. It loads in 5ms!

    What kind of server is it?

    I saved the file to my hard drive so I could test it without pounding the server.



  • @blakeyrat said:

    The guy looked at me like I kicked his dog, then gave me some stuff he'd memorized from a trade conference about how some ad server was using node.js and as a result they were the "fastest ad server", to which I pointed out...
    Stop right there.

    You'd already lost the job at this point.  You might as well just tell the guy his mother's a whore and be done with it.



  • I got the job.

    But the question still applies, even more importantly because now it's almost certain I'll be touching node.js in the near future.



  • @blakeyrat said:

    I got the job.

    But the question still applies, even more importantly because now it's almost certain I'll be touching node.js in the near future.

    Well, there is this:  http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js

     



  • @blakeyrat said:

    I got asked about node.js at a job interview, and I gave my honest opinion which was this: when I looked into it 3-4 years ago, it seemed like 90% hype 10% meat, and I didn't understand exactly how (technically) it could possibly be faster than a traditional web server, even in theory.

    Chiming in;
    When you measure performance for a web application, there are two critical and different aspects: how fast it is and with how much load it can cope. For instance: a web app could process 100 concurrent requests at 100ms each, or it could process 500 concurrent requests at 500ms each. The whole point of Node.js is that it was designed back to front with fully asynchronous, parallelized IO in mind. This allows it to cope extremely well with heavy load and is likely why it is a good fit for simple (i.e. not algorithmically complex) requests for excessively large pools of simultaneous users. Ad serving farms are actually a good example of this.



  • Ok that makes sense.

    I guess what's throwing me, to ask some more specific questions, is:
    1) How does node's asynchronous, parallelized IO lead to that result?
    2) Why can't you simply implement asynchronous, parallelized IO in like... 50 lines of code in your favorite language? In other words, why should a company switch their entire stack to the node stack instead of just taking its good feature and adding that to their existing stack? It's hardly rocket science to write a web server.
    3) Does node's design fall apart when the complexity of the app increases, as it surely will?

    And of course:

    4) does node have *any* decent dev tools? I'm Googling and coming up with jack shit. It looks like Komodo is basically it, and it's... blearck. At least it's not Java, I guess.

    (Off-topic, but a huge pet peeve, whenever you ask for a good IDE, people always respond with text editors. Look buddy, we know you love Vim. We know you suck Vim's virtual cock every fucking day. Hell, for the sake of argument let's actually say Vim is, in reality, the Best Text Editor Ever Made Ever By Anyone. But it's still not a fucking IDE, and not the answer to the fucking question. Go the fuck away and let the grown-ups talk!)


  • Discourse touched me in a no-no place

    @blakeyrat said:

    1) How does node's asynchronous, parallelized IO lead to that result?

    If your workload is virtually IO based and you've got all the IO operations designed to work asynchronously (not as easy as it sounds, alas) then you can scale up a lot because you've not got crazy-ass concurrency bugs in the way. Basically, you're pushing a single thread to work much harder than normal.
    @blakeyrat said:
    2) Why can't you simply implement asynchronous, parallelized IO in like... 50 lines of code in your favorite language? In other words, why should a company switch their entire stack to the node stack instead of just taking its good feature and adding that to their existing stack? It's hardly rocket science to write a web server.

    It takes rather more than 50 lines, but many of my favorite languages do have it. Some other languages (I'm looking at you, Java! Stop hiding at the back!) sort-of have it, but in a half-assed way. They're not my favorites.

    You've probably got different favorite languages to me, and async IO is a feature that's often not explained to people early in teaching programming. (I don't know the .NET framework at all well enough to be able to comment, for example.)

    Users really don't understand asynchronous systems. I spent most of an afternoon trying to teach someone (a very smart lady who writes amazing programs to analyse biodiversity data; a good programmer within her domain) how to handle asynchronous calls of her service; total failure, despite my being as clear as possible and she really wanting to understand.
    @blakeyrat said:

    3) Does node's design fall apart when the complexity of the app increases, as it surely will?

    Probably, but that's true for most languages. (I suspect that most language designers don't concentrate on handling very large scale complexity to start with, and most programmers don't learn that stuff, so there's a steady selection pressure against languages that designed to cope with such things from the ground up. The few I know of have ended up sucking a lot because other aspects of the language were neglected.)

    It's simple: node.js is the hot new thing in town, motoring up the hype curve! Expect disillusion to set in in 6–18 months, and babies to be thrown out with the bathwater shortly after that.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    does node have any decent dev tools? I'm Googling and coming up with jack shit. It looks like Komodo is basically it, and it's... blearck. At least it's not Java, I guess.
    No idea. However, searching for “node.js visual studio” (that's you're preferred toolset, yes?) turned up this link so maybe you can use that. No idea if it's any good.

    I've also found people working on a plugin for Eclipse and there's been stuff for NetBeans for a while apparently. I've no desire to use node.js — my services are naturally compute-bound, not IO-bound — so I've no direct experience with any of them. (Most of my colleagues who are in the area use Ruby instead. Bleah. Ruby has some really annoying misfeatures.)


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.