Hacker News new | ask | show | jobs
by tegeek 4596 days ago
I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS.

1. Takes 1 minute to install on any platform (*nix, windows etc.)

2. A modern Package Manager (NPM) works seamlessly with all platforms.

3. All libraries started from 0 with async baked in from day 0.

4. No need to use any 3rd party JSON serialize/deserialize libs.

5. And above all, its Atwood's law

"any application that can be written in JavaScript, will eventually be written in JavaScript".

http://www.codinghorror.com/blog/2009/08/all-programming-is-...

6 comments

Not meaning to troll but:

1. apt-get install php5 ? Seriously, that's it. On the other hand, neither Debian stable nor Ubuntu LTS have any usable version of node in their package repository (Debian has nothing, Ubuntu has 0.6)

4. json_decode() ?

5. If Atwood's law ever becomes reality, it will be a consequence, not a source of benefit.

(I don't use either Node or PHP as my main language)

I've developed software in Java,.NET, Php & NodeJS. I ll rate JVM higher than any other platform. But when it comes to simplicity, easy scalability, Node ranks way higher. Php isnt even closer at all.

NodeJS literally takes 5 minutes to get started writing scalable apps without even thinking about concurency at all.

Write a software in Php yourself and let people download and run themselves, there are endless pain. Actually Php sucks in many areas which I dont want to touch right now.

Actually Debian testing has : nodejs 0.10.21~dfsg1-1
I think the only valid point here is your 3rd one.

1. You have to be kidding, right? PHP's popularity is precisely because of this.

2. getcomposer.org

4. json_decode/json_encode have been a part of PHP since PHP 5.2 (2006)

5. That's not a benefit.

No, it's popularity is because it was the simplest a long time ago, and it's supported on lots of virtual boxes by default.

Composer is terrible compared to NPM.

Says you :)

And so is PHP. You cannot argue that PHP is not simple, you just can't.

And frankly I like composer, sure it doesn't do C/C++ installation stuff, but PHP doesn't need that. What is does is almost identical to NPM, the only different is one looks different, and the names.

..and how do you think it got on all of those boxes? That's a chicken/egg argument.

Composer accomplishes the goals of being a "modern package manager that works on all platforms".

I'm not 100% on whether this is serious or not, but what the hell:

1. My recent installs of node have required compiling from source to get anything remotely up-to-date, however there are packages for both,

2. Composer with the Packagist registry is comparable here - you might be thinking of PEAR.

3. JS certainly has much better async support - it being JavaScript after all.

4. PHP has JSON encoding/decoding bundled, no third party lib required.

5. For better or worse

Yet there are no decent XML libraries for node.js.

I'd trade decent JSON support for decent XML support every single day of the week.

And Scala/Java/JVM have already solved the problems you mention above.

"I'd trade decent JSON support for decent XML support every single day of the week."

Just out of interest, why is that?

I work with JSON at least once a week, but it can be months between moments when I need to work with any XML.

I quite like https://npmjs.org/package/sax

What is it you think is missing XML-wise in Node.js?

1. libxmljs can take you pretty far with NodeJS.

2. Whatever we're saying here includes only NodeJS vs PHP.

You seriously don't know what are you talking about.
All your points are good apart from 4, don't the native json_encode() / json_decode() functions do what you need?
Actually, only 3 is good. The rest are incorrect, entirely, and 5 is debatable as to whether that's a good thing.