19 ms·
Uhmm, I've been writing server side code for the last decade. I've also been writing front facing code for just as long. JavaScript works well for Node because
by maratd 15y ago
Uhmm, I've been writing server side code for the last decade. I've also been writing front facing code for just as long.
JavaScript works well for Node because it is a language that has evolved to be asynchronous. Not because some front-end web monkey n00bz know JavaScript. Although that is certainly a plus.
Node.JS shines when you need to write network applications. It was advertised for this purpose by its creator. That is its stated goal.
Traditional server-side solutions SUCK at this. Try writing a non-blocking server-side WebSocket server in PHP and distribute the load across all of the cores. Yeah. Exactly.
Don't get me wrong, I love PHP. But for every job, a proper tool.
Node.JS takes care of the network server and hands off the work to PHP via FastCGI. That's how it should be. Node.JS solves real problems right now. If it isn't doing that, you're trying to hammer in a nail with a screwdriver. Stop it.
- _delirium 15y agoTraditional server-side solutions SUCK at this. Try writing a non-blocking server-side WebSocket server in PHP and distribute the load across all of the cores. Wouldn't the traditional way to do it server-side be to just write it in C/C++ or Java with a thread pool? Or if you prefer the evented model, Python+Twisted isn't old enough to really be traditional, but is pretty widespread; and some Java server-side apps have been moving to an async model as well.
- maratd 15y ago> Wouldn't the traditional way to do it server-side be to just write it in C/C++ or Java with a thread pool? I was a bit vague. What I should have said was that dynamic language solutions are bad at it. Certainly you can pull out C/C++, Java, Erlang, etc. but at that point, you need to compile and recompile when you change your code. You are dealing with dependencies, libraries, binary compatibility, and the usual complexities that come with compiled languages. > Or if you prefer the evented model, Python+Twisted Well, Node.JS isn't the only game in town, certainly. Competition is a good thing.
- zzzeek 15y agoI don't actually think anyone should be using PHP. Just like MySQL gives relational databases a bad name, PHP does the same for server side programming. And yes actually trying to write a server in PHP would be ten times more insane. Node.js might be nice for writing servers but so is Twisted or straight Python, Erlang, C, even java with threads as someone mentioned.
- edtechre 15y agoMySQL gives RDBMS a bad name? What planet do you live on? And how/why the heck would you write a web server in PHP when it was made to run embedded in a web server process? Yes, I'm sure you could twist and mangle PHP so it could be used to write a standalone web server. But that would be assanine.