Quote:
Originally Posted by Google
If I'd take it in the context you are talking about, this is one of many heresies that is not going anywhere. Such event-driven type of languages is better be used only for GUI (as a model for interaction). Using event-driven languages for other purposes (taking over PHP) is dangerous for many reasons like not being thread-safe, need to write code within the event handler for each possible value of various values in the program, and requires the programmer to keep an eye on shared variables to avoid what we call "ripple effects".
This implies code that is complex (Scalability?) and error prone (Security?).
Now these are some of many reasons why this language fails. Could Node.JS in theory take over PHP? No.
|
You're comparing oranges to apples, Freddy didn't mean Node.js will replace PHP, he was just answering you that Javascript doesn't only work in a web browser but also anywhere; it's just a language that uses bunch of APIs be it the browser using DOM or server side using sockets, GD or any other API.
What Node.js guys did is that they used Google Javascript v8 engine with their own APIs on the server side. There's nothing magical in that.
Node.js on the other hand is more used as a networking programming language at least for now, this might change later.
It's just awesome for so many things, i advice you to watch the video below:
Javascript is quite fast for an interpreted language, the DOM is what actually makes it slow in browsers.
Prototype-based programming is not common but quite flexible and featured, if done well, it will be as good as client side programming if not better.