PHP vs. Node.js: the Battle For Developer Mind Share 245
snydeq writes: Simplicity vs. closures, speed of coding vs. raw speed — InfoWorld's Peter Wayner takes a look at how PHP and Node.js stack up against each other. "It's a classic Hollywood plot: the battle between two old friends who went separate ways. Often the friction begins when one pal sparks an interest in what had always been the other pal's unspoken domain. In the programming language version of this movie, it's the introduction of Node.js that turns the buddy flick into a grudge match: PHP and JavaScript, two partners who once ruled the Internet together but now duke it out for the mind share of developers."
Jesus Christ (Score:5, Funny)
This would be the worst movie ever.
Re: (Score:2)
I don't know. It sounds slightly more interesting than a movie about a font [imdb.com].
Re: (Score:2)
I watched that movie. I really liked it.
Re: (Score:2)
Only the third one was really that bad. As long as you went in expecting a more lighthearted story than LOTR.
okay (Score:5, Insightful)
I actually RTFA and found it to be completely useless.
My brain fell out (Score:4, Interesting)
This isn't merely useless, nor just bad, it's completely misleading. For it may look like he's giving the high-level, the author appears to have no depth to draw on to say more than the shallowest things. As such, he's presenting pond scum, not the high points from an expert deep sea fisher.
And this is pretty bad, given that infoworld says about themselves [infoworld.com]:
while the TFA says about the author:
I'm loath to seek out his writing, in fact fairly convinced to stay well away, while at the same time morbidly curious just how bad his "more than 16 books" will misinform.
Re: (Score:3, Interesting)
I'm loath to seek out his writing, in fact fairly convinced to stay well away, while at the same time morbidly curious just how bad his "more than 16 books" will misinform.
The sad thing is, his writing doesn't seem to much better or worse that what you get with most computer related books these days.
Re: (Score:3)
RIP Abstruse Goose
Re:okay (Score:4, Interesting)
And plain wrong in many places.
There's nothing about either Node or PHP that forces you to use or not use HTML or service calls.
Same for separation of concerns (which pretty much boils down to the same thing).
For instance; both PHP and Node handle SQL equally well, i.e. they can both hook up to most databases and let them deal with SQL.
Same for JSON. Just because it kinda looks like Javascript and started out loosely based on it, doesn't mean Javascript handles it differently.
I also don't think these two were ever "old friends who went separate ways". They started out separate.
Re: (Score:3)
Its generally a matter of what the community/ecosystem is optimized for. ie: Python is pretty damn good at math stuff. But it has nothing to do with Python itself, its just the community built fantastic math libraries in python, generally because of historical reasons.
In the same way, an obvious example, if you want to do web sockets, while you can make them in any language, Node is a prime contender there. Examples like that exist for any language.
Re: (Score:2)
But it has nothing to do with Python itself, its just the community built fantastic math libraries in python, generally because of historical reasons.
Yes and no. One key strength of Python with regard to math is its built-in support for complex numbers. Without that, Python probably never would have attracted the attention of people who write complex (but not complicated) math libraries.
Re: (Score:2)
But nodejs s bad rock star tech!
https://www.youtube.com/watch?... [youtube.com]
Re:okay (Score:5, Funny)
InfoWorld
If you still click on the link after that, then you only have yourself to blame. I bet you click on goatse links too.
In the real world (Score:4, Interesting)
Re: (Score:2)
Unfortunately, because of the network effect, it is actually quite important that you fight for your choice. Let's say you like PHP but no one else does... you will quickly find that tools for writing PHP dry up/don't get updated for new OSes. If you like Windows Phone, you're going to need to "sell" your preference to all your friends or eventually you'll have to switch to Android or iOS because if the Windows Phone platform doesn't get enough mindshare, it goes away.
Mindshare matters, and your company can
Before reading TFA ... (Score:4, Funny)
... JavaScript must die. I expect TFA to concur.
Re:Before reading TFA ... (Score:5, Funny)
But so does PHP. In this battle, whoever wins, we lose.
Re: (Score:3)
Re: (Score:2)
In this case wouldn't mutually assured destruction (MAD) be exactly what you're going for?
Re: (Score:2)
Oh god no, not yet another language.,It isn't bad enough that we already have a ridiculous number of languages that vanishingly small numbers of people use, and serve little purpose more than to be the software equivalent of leftover land mines ?
I can already see the design process for this.
Hmmm Python is hip and current, lets take their indentation scheme.
Lots of people know cobol maybe we can pick up that developer base if we make the keywords and IO look like Cobol.
ADA had really powerful modules and cod
Nuke the Web! (Re:Before reading TFA ...) (Score:2)
first let's get a better GUI standard than browser-based DOM. Customers want desktop-like UI's on the web, and HTML/CSS/JS/DOM has to be force-bent under threat to pull it off, and still broken or jittery half the time even on big-name deep-pocket sites.
Sure, it's job security, but at the expense of turning grey prematurely.
The programming language choice would matter less if the programming language didn't have to do so much to deliver GUI's.
Re:Before reading TFA ... (Score:5, Informative)
Re: (Score:2)
... JavaScript must die. I expect TFA to concur.
script type="text/python" ... still waiting for it
Re: (Score:2)
script type="spoken/english" would be more interesting
Re: (Score:3)
script type="x64"
I don't want something else that my computer has to interpret. Do all the compiling before it shows up on my computer so that I don't have to deal with this: http://i.imgur.com/b2uUrIL.png [imgur.com]
Even "JIT" compilers start to suck when you have a few dozen of them running at the same time.
Re: (Score:2)
So much for cross-platform. So even obscure web sites need to compile for: x86, x64, IA-32, ARM, am I missing any?
Re: (Score:2)
Re: (Score:3)
But of course to make it run faster, you can use a JIT compiler to recompile that to native code....
Re: (Score:2)
So use it like html5 video and have javascript backup.
script x64="uselessWidgetJavascript.x64" x32="uselessWidgetJavascript.x86" javascript="uselessWidgetJavascript.js"
If you lumped 90% of all internet devices on the web they'd probably fall under x86, x64, & ARM.
Additionally Apple has figured out how to do fat binaries.
Re: (Score:2)
Oh, that seems much simpler (/sarcasm)! And of course someone's going to want to save time writing 3 versions, so they'll write in JavaScript and cross-compile to x86 and x64 to save time, increase compatibility, and reduce bugs. Should be easy enough to create a compiler, since we already have JIT compilers on most platforms. And wait...now you're just moving from JIT to pre-compiled and not really changing the status quo.
By the way, fat binaries are great for mobile users on a capped connection.
Re: (Score:2)
save time writing 3 versions,
Did I say write 3 versions? Just do all of the JIT compiling NOT on my computer.
JIT to pre-compiled
That's the point. Why are we using the battery power of thousands of tiny little ARM devices to compile something that could have been compiled once?
When you boot your Laptop do you recompile everything just so you can grab the source daily?
Re: (Score:2)
The point is, the problem isn't the compiling. It's the bloat. When your app is built on top of a monstrous framework (jQuery's not even that bad on its own), it's going to be slow. Bad developers are going to make bad code and compiling it will not fix the problem.
Re: (Score:2)
And by the way, would you really run binary code directly from a web site on your computer? There's a reason you're essentially using a JS virtual machine. Makes sandboxing much easier.
Re: (Score:2)
Look, I feel your MATLAB pain too, but isn't it stretching to blame that on Node?
Re: (Score:2)
When a computational package designed to manipulate massive data sets uses less RAM than facebook I kind of think we're doing something wrong.
Re: (Score:2)
[...] so that I don't have to deal with this: http://i.imgur.com/b2uUrIL.png [imgur.com]
Yeah, I wouldn't want to have to deal with Windows either. I feel ya.
Re: (Score:2)
Agreed. I can't open more than a few javascript heavy pages without this happening: http://i.imgur.com/b2uUrIL.png [imgur.com]
All of those tabs have terrible javascript trying to give me a decent Web 2.0 experience.
Re: Before reading TFA ... (Score:2)
Re: (Score:3)
GWT?
So Java Really is the new Java?
Re: (Score:2)
oh yeah, thats working so well for Amazon /sarcasm.
Re: (Score:2)
SubjectsInCommentsAreStupid (Score:4, Insightful)
Now cue the apologists.
Re: (Score:3)
That's why node.js is rightly describable as nothing more than a toy for people who don't know what they're doing.
I'm not sold on node myself, but I'm pretty sure the guys at PayPal, Yahoo, LinkedIn, Dow Jones, etc. just might be capable of making an informed decision.
I get it, you don't like javascript. Well, at least you don't think you like it -- it's pretty cool right now (on slashdot) to believe that it's irredeemably bad, so I'm not sure if you've actually formed your own opinion after taking the time to learn the language or not. Few people actually do take the time, after all, and not too many of those retain
Not the same use cases (Score:5, Informative)
These two languages each have their own use, and to chose between them you should not ask which is better but which is closer to my use case.
PHP, for all its problems, is still a very useful language for developing web sites, if only for the quantity of tools (frameworks, cmss, etc) available and their quality (far from every php tool is good, but you can easily fond a quality tool for each category: symfony 2 is a very good oo framework, drupal and ez publish are good cms...).
Node is younger, and does not have such a toolset. Sailsjs is a good framework but far from mature.
But it does what php can’t: a nodejs application is its own server and runs continuously, instead of being a set of scripts that must reload everything with each request.
It makes it a very good language for real-time uses, like the back-end of a small multiplayer game.
Re:Not the same use cases (Score:5, Insightful)
Node.js is also seeing a lot of use as a tool set provider for other build environments - see Grunt and Gulp, both need Node.js to function. You don't see PHP as that diverse in use.
Re: (Score:3)
uh... you tell us?
Re: (Score:2)
"But it does what php can’t: a nodejs application is its own server and runs continuously"
Not true. Because PHP has wrappers to all the underlying C-functions you need to create a socket server. See socket_ functions.
Also, you can fork new processes with the pctnl_ functions and have IPC with the shmop_ functions.
Using this functionality you could build a more advanced webserver than node.js which, btw, has some terrible bugs in its socket reading algorithms.
Re: Not the same use cases (Score:2)
Just want to point out there is also the pthreads extension (through PECL). See http://pecl.php.net/package/pt... [php.net] and http://php.net/manual/en/book.... [php.net]
I'm currently building a proof of concept instant messaging platform (server and client) with php, pthreads, and sockets.
I could write it in node.js, but I really like the C-likeness of PHP.
Re: (Score:2)
Sorry, you're right. I mistook a proxy written in nodejs by one of our programmers for a standard library for nodejs.
Re: (Score:2)
Symfony, Drupal, Wordpress, nah. They all forgot to include the most important thing in the base: security. Specially Wordpress, look at its spaghetti code and than look at the Banshee PHP framework [banshee-php.org]. If you understand what that framework does for security, you'll never dare to run Wordpress or the other junk frameworks again.
Re: (Score:2)
Wordpress is junk, on par with joomla. It assumes a lot of things and as soon as you wander bayond its core functionality (a blog). Seriously, how can disabling in code, with no possibility to override it) unfiltered html in content for everyone except the super admin if and only if the multisite mode is enabled be called a security feature?
Symfony 2 does most things quite well (the authentication process is a nightmare), drupal does some strange things (and community modules go from "utter crap" to "pretty
Re: (Score:2)
there's already too many nodejs toolsets.
ends up with plenty of bloat with everyone on the project losing scope of where stuff happens...
though, node is pretty nice for plenty of stuff. certainly far better than php for just about everything, unless you're a php only coder... if you're the sort of who just used php, the rails or whatever and autocreated mostly everything then yeah there's that too for node.js. don't know why you would want that though in the modern world. most projects use frameworks for th
Re:Not the same use cases (Score:5, Funny)
A big steaming pile of crap is still a big steaming pile of crap, no matter how large the pile.
When you want your corn field to produce corn, nothing's better thant a big steaming pile of crap.
Re: (Score:2)
When you want your corn field to produce corn, nothing's better thant a big steaming pile of crap.
What about dead fish?
Re: (Score:2)
you can dance with fish
Re: (Score:3)
you can dance with fish
Um
--Fish Heads, 1980.
Re: (Score:2)
Until it gets too big, rots your crops, runs off and infects your water supply with e-coli.
Sadly this metaphor is still going strong.
Missing (Score:5, Interesting)
PHP is far more available in cheap hosting solutions. The apps are simpler to deploy (simply put them along your static html files in a web server that supports its extension), and simple apps are simpler in php. The ecosystem around was not touched in the review, Compose vs npm, joyent vs the community behind php, the future of both platforms.
In the other hand, PHP is (or at least, used to be recently enough) a fractal of bad design [eev.ee]
Re: (Score:3, Insightful)
People stuck on "cheap hosting solutions" don't pay good money to developers to develop software for them. Cheap hosting solutions don't even come close to scaling to anything beyond a blog for a local business.
Unless you've decided to work on a bottom of the barrel open source CMS/Forum system (a market that's pretty much saturated already), the argument that "PHP is the only thing we can run" is just not relevant. Maybe it carried some weight ten years ago but it's a non-issue these days.
Re: (Score:2)
VPS hosting and IPv4 address exhaustion (Score:2)
How long will these VMs remain affordable as more and more web site operators switch from shared hosting plans to VMs that need their own IPv4 address?
WebFaction or VPS (Score:2)
Can't someone seeking hosting just get an $8/mo WebFaction account and set up PHP and Node sites under it, or get a $10/mo VPS and deploy whatever the expletive he wants?
terrible article (Score:4, Funny)
Man I've read articles where the author didn't know what they were talking about and was just stacking points, but they're made here with such assertiveness and surety that I started doubting reality. +1 great trip, no mushrooms required.
The battle of WEB developer mindshare (Score:2, Funny)
Proper systems and apps developers wouldn't touch either of these noddy languages with a sterilised bargepole.
Re: (Score:3, Interesting)
Proper systems and apps developers wouldn't touch either of these noddy languages with a sterilised bargepole.
So what would these "proper" developers of yours actually use?
Python - No way in hell .. the language has to bend to my will, not me bending to its will. .. "It's a trap" /Ackbar
Java - Antiquated and full of perversions, along with the spectre of Oracle hanging over you.
C/C++ - I know it is done, but would you?
C#/VBV.Net - Even with MS opening up things
Perl - Are you sure its actually serving pages and not just a prank obfuscated programming contest entry?
Go - You and the 3 other people using it should get
Re: (Score:2)
Don't feed the trolls.
[John]
Re: (Score:2, Interesting)
C#/VBV.Net - Even with MS opening up things .. "It's a trap" /Ackbar
I would love for some Star Wars fixated Slashdot geeks to explain just how the current situation and plans are "a trap"? I've developed on the .Net platform for the past 7 years, I've not been trapped yet - MS hasn't attempted to gain control of my code, hasn't limited where I can deploy, hasn't told me off for deploying MS libraries on non-MS platforms etc etc.
Today, I have a choice of multiple front end web frameworks competing with the MS offerings on the .Net platform but not one of them has suffered i
Re: (Score:2)
So where is this trap that Slashdotters have been shouting loudly about for the past decade?
While my intended use of "its a trap" was a facetious repetition of a meme (and I won't bore you with a whoosh), I believe the trap is not so much the technical aspects of the tools and code (I have always preferred VS over Xcode, and c# over Obj-C), but the morals of the company that you are buying into by using their code. From It's not done until XXX doesn't run and Embrace, Extend, Extinguish to the subversion of the OOXML standards process there are many distasteful things that MS has done as a compan
Re: (Score:2, Interesting)
Firstly, no whoosh needed, I understood the meme but just think its horrifically overused and just plain shit. But then I am tiring of all of the memes that call Slashdot their home these days, people tend to use them for a quick laugh or a "I'm in the group!" stamp rather than putting forward actual enticing arguments for their views.
Secondly, MS does have a history - so does all large long lived companies. I was on the anti-MS band wagon back in the late 1990s and early 2000s, but then I grew up and wat
Re:The battle of WEB developer mindshare (Score:5, Insightful)
"Python - No way in hell .. the language has to bend to my will, not me bending to its will."
Few languages bend to your will, some learning is always required. I'm not terribly convinced the learning curve for Python is less than for PHP/Javascript given that those two have so many dangerous nuances that it takes years to truly understand them and develop with them without falling victim to their countless pitfalls. If you don't like the syntax of Python that's fine, but it's hardly a compelling technical argument not to use it over PHP and Javascript.
"Java - Antiquated and full of perversions, along with the spectre of Oracle hanging over you."
Java is antiquated? It was first released in 1995. That's the same year that both PHP and Javascript turned up you realise?
As for perversions, what perversions exactly? It's a pure OO language and sticks to that properly. Compared to Javascript that really doesn't know what it is and has functionality that's basically broken like closures because it tried to do away with explicit pass by value and pass by reference meaning you need to do horrible hacks to force creation of a new scope if you want to pass by value into a closure rather than have a variable captured.
PHP? It's about as perverted as you can get. It started out basically like C for the web, but without the difficult stuff. Then it did exactly like C++ and tried to glue OO on top, only C++ kinda worked because it was done by a competent computer scientist whilst PHP had it's OO tacked on by a mob of wannabes.
Out of the 3, Java is no older, and is the only one that actually determined and stuck with a consistent and planned design philosophy. Your criticism therefore seems to be wholly nonsensical in the context of comparison against Javascript and PHP. The very fact that Javascript was rushed out with a similar name in the same year as Java to cash in on it's hype should at least tell you something about the quality of Javascript as a language if nothing else.
"C/C++ - I know it is done, but would you?"
It really depends what you're doing and how competent you are.
"C#/VBV.Net - Even with MS opening up things .. "It's a trap" /Ackbar"
If it's a trap then it's a pretty poor one because they keep on open sourcing more and more of it. First they go and make the language a real actual standard, and then they start open sourcing the framework whilst giving Mono their explicit blessing.
Microsoft now isn't Microsoft the 90s, it has realised that it needs C# to be runnable in as many places as possible like Java, hence why they opened up the core and plan to open up more and more of it. Nadella knows they lost the smartphone war, and he knows that Windows Server hasn't taken over the server world. He knows that the only way to get a foothold in these areas is to at least take what it does well there - development tools and technologies. The newest version of Visual Studio even supports Android development.
You seem to have pulled together a list of pretty weak criticisms of each language and pretended that's justification not to use them over PHP and Javascript despite PHP and Javascript both having glaring deficiencies that make the negative considerations you pass off as fact above wholly irrelevant in the grand scheme of things.
Each technology has it's merits, but saying I'm going to use a technology with 100 deficiencies because the alternative has 1 deficiency seems to me to be a bit short sighted (no zealots, please don't take the 100 to 1 literally, it's intentional hyperbole to make a point).
At the end of the day we're stuck with Javascript on the client for the foreseeable future and that doesn't bother me too much. But why use it or PHP on the server when there genuinely are just all around better alternatives for that particular case?
I don't even buy the Javascript on the server because you can share code with the client thing either - your server objects automat
Re: (Score:2, Funny)
Dumbest article on the subject. Ever. (Score:5, Interesting)
TFA is a bunch of blabbering from someone who has no idea what he's talking about - void of anything useful.
To get this out of the way:
Node.js is a serious contender to topple PHP off the server-side, for the simple fact that we would then have one PL less in the entire webstack, which is way to
complex anyway.
I myself have been pondering trying out Node for larger non-trivial projects. I'd be the first to switch if it were possible.
I haven't yet - Node is just not quite ready for prime-time.
Why?
1.) The tools don't exist yet and Node seems to gather the same problems Rails has: A bloated, instable and unreliable mumbo-jumbo of countless libs, tools and extensions - various package managers included, each built on a whim and powered by a neat logo and a 6-week fad that sweeps the community and adds to the mess already there. In short: The Rails problem of to much navel-gazing and not enough of solving real world problems.
2.) Callback hell.
In fact, its Node/JavaScripts callback hell that made me realise a thing that is so great about PHP: What you see is what has been made, for you, for that specific request. LAMP is such a bizar solution no one in his right mind would suspect it could work, yet most site on the internet run on it. The stack is so vertical it actually makes any Java solution look like an ADHD driven Visual Basic School projekt in comparsion. And I mean vertical right down to the way it actually works!
Try building anything like Joomla or Wordpress with other solutions such as JS and you'll end up with problems that completely leave the domain of your work. The simple fact that a PHP request is dead and gone when its finished sending its request reply and all the rest it offers is custom built around any strange problem the
Any concern you have right at the moment when developing for ther server side web PHP has neatly covered ... ok, forget I said neatly, ... but covered and everything else is put aside. PHP is born out of a template engine, and as bizar as it sounds, that's its advantage [slashdot.org]. Any problem the Web domain can come up with puts PHP in a very strong position. Serverside things PHP just shrugs of with some strange custom internal function has JS and Ruby tripping and falling flat on their face with no chance for rescue.
3.) PHP is 10 years ahead of the game. No joke.
Try finding a product like Typo3 or Wordpress in Java, Node, Rails or any other backend runtime you fancy. Won't happen. It take me 5 minutes to download Typo3, 2 hours to set up - mostly because configging Apache and setting up T3 is an arcane science unto itself - but then it's there. Everything I would ever want for a web product.
Joomla, Drupal, Wordpress and co. are even way easyer. The only other contender holding up is Pythons Zope/Plone. All else is a decade behind at least. Rails included.
Bottom line:
As soon as Node gets their shit sorted out and offers a serious upside vis-a-vis LAMP, PHP is going to continue to rule. It gets the job done. Node and Rails don't. End of Story.
Re: Dumbest article on the subject. Ever. (Score:2)
.Net has Sitecore are Sharepoint. Java has AEM (which is what Typo3 tries to be) and several others. These of course are "enterprise" proprietary solutions, but just as easy to install and configure. I could spend hours talking about what a joke Typo3 is. The truth is that web CMS platforms use PHP because it is the defacto standard in shared hosting plans, just like most desktop games are written for Windows with DirectX.
Re: (Score:2)
Besides......the only reason to write javascript is to execute code in the browser on the client side. If you're not doing that don't use javascript.
The appeal of things like Node.js is that you're writing the front and back ends in the same language. Thus reducing the number of languages you need to know etc.
And while that is a laudable goal, I'm not sure that javascript is the best way to achieve it - but then there is that inertia thing again - you already have javascript in the browsers. So it would take a huge commitment to get another language into the same position.
Re: (Score:2)
Unfortunately PHB's assume all projects are trivial until the pool of blood on the carpet starts leaking out the door.
Re: (Score:3)
PHP is the same way, where a syntax error in a file referenced by include_once will stop the interpreter cold, and you can't even catch a syntax error. (You can in Python; it's considered an ImportError.) I guess that's why you're supposed to lease two VPSes, one for testing and one for production, and run the complete set of integration tests on testing before pushing it out to production.
Deployment challenges matter too. (Score:2)
And to make it worse there is no attention given to this problem in any of the fad2.0 communities, ie nobody really wants to build the new standard
So one shitty language has been ... (Score:2, Flamebait)
replaced with another shirty language. This like arguing which is worse: bull shit or horse shit -- guess what, they both stink.
This isn't a battle - they both suck. A developer uses whatever crappy web language there is to get the job done.
News at 11.
Re: (Score:2)
Forgot the links
* http://whydoesitsuck.com/why-d... [whydoesitsuck.com]
* http://whydoesitsuck.com/why-d... [whydoesitsuck.com]
Meh... (Score:2)
I still use Mason.
comparing node to php? (Score:2)
Thats a weird comparison, since they don't target the same audience at all. Rails maybe, as it has a lot in common, but even then.
What makes node interesting is that its asynchronous-first, single-threaded-by-default model has interesting performance characteristic and lends itself well to specific architectures. Bonus that it also works amazingly well for web sockets. There's also a lesser point that still matters, its JavaScript and some people like that a lot.
The tradeoffs however are pretty massive. The
The tyrany of choice. (Score:3)
Cancer versus AIDS. Which to choose. decisions decisions decisions.
Have you ever used PHP? (Score:2)
Seriously, I am always baffled by everyone who starts ranting on how crappy PHP is. I have done mostly PHP development for 12+ years. I have yet to have a site hacked, or SQL injection exploited. It is a very solid language, it can be made VERY fast (JIT is also coming down the pipe out of the box in 6+). It lends itself to rapid prototyping and easy patching / testing. There is a mod
Re: (Score:2)
Re: (Score:2)
PHP is a shit language.
* http://whydoesitsuck.com/why-d... [whydoesitsuck.com]
* http://whydoesitsuck.com/publi... [whydoesitsuck.com]
Just do it in C++ (Score:2)
Just write it in C++ with TDD, which will run faster, and after you factor in all the pain from debugging server side untyped dynamic languages, will also be faster to develop.
Let the flaming commence.
Those who cannot remember the past ... (Score:2)
"But then some clever kid discovered he could get JavaScript running on the server. "
Really clever kid. We had this in 1994.
Apart from all the other languages (Score:2)
But then some clever kid discovered he could get JavaScript running on the server. Suddenly, there was no need to use PHP to build the next generation of server stacks.
What is this blogspam shit doing here? There's no "need" to use either of them, there have been loads of alternatives to PHP for years and there are still plenty of alternatives for both. The individual points make no sense either, it's like they've just quickly Googled for "PHP advantages" and "Node.JS advantages", bullet-pointed them on a page and stuffed the rest full of ad links.
Who would play PHP ? (Score:2)
Charlton Heston? I mean if he was still alive, not that PHP is still alive.
Re: (Score:2)
"Where Node wins: Service calls are thinner than HTML-fat PHP calls"
Now I understand why browsing the web became impossible on my cellphone in 2014. Displaying a page is no longer about html + css. Now it's a stub page which needs a dozen more ajax calls before anything gets displayed. And good luck reading the article through the tangled mess if one of them doesn't get loaded. Oh well, it's just the current phase in the 10-year thin client sucks/thick client sucks cyclic history repeating itself.
Black Friday '14: E-commerce Pages Far Slower Than They Were in 2013 - Slashd [slashdot.org]
Re: (Score:2)
Oh well, it's just the current phase in the 10-year thin client sucks/thick client sucks cyclic history repeating itself.
No...this is a new phase. The "It takes a fat client just to run the thin client" phase.
Identical validation logic on both sides (Score:2)
What, AJAX is Node-only?
It is if you want to share validation logic between the client (which on the web must be written in JavaScript or a language that compiles to JavaScript) and the server. If the validation logic in both environments is provably identical, you can validate on the client for instant feedback and then revalidate on the server for security, and there will be no confusing or insecure inconsistencies between the two. Otherwise, you have to translate from one to the other, and manual translation is fraught with pot
Re: (Score:2)
I'm sure that's how you use Note.js, but as far as I can tell, the vast majority of the usage of Node.js is server side. And that's where it overlaps with PHP. They both can be used to do the same thing, but with different strengths. For example, if you're building a modern AJAX app, Node.js is very nice - it's very efficient, lets you use the same programming language for the client-side and server-side code, uses JSON to pass data, is event-driven, good at web services, etc. PHP's strengths are more for t
Re: (Score:2)
No, he's right. The vast, vast majority of node.js use is as a glorified scripting environment as a build system for static resources. Its its gateway drug in a way. People use LESS to minify their javascript or something in their language of choice's assets pipeline. Then they go "Hmm, what if we used a real build environment for these?". Then they start using node in their build system. There's also stuff like Atom and all the node-webkit applications that use it as desktop apps. Those are the common usag
Re: (Score:2)
PHP's strengths are more for the old-school, non-AJAX web sites
PHP's not bad at encoding JSON either. What else do you need to make it "AJAX-friendly?" (nevermind that the X in AJAX still technically stands for XML - not that that would be useful).
Re:Uh, okay. (Score:5, Insightful)
But seriously, PHP is a dying language. We should let their developers pass.
No no no, you did that wrong!
Kosh: It is a dying language. We should let it pass.
Sheridan: PHP, or Node.js?
Kosh: Yes.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
"PHP is a bit so-so. It does its job, but doesn't really offer anything new or innovative language wise"
Prior to PHP, people were writing CGIs. Language-wise doesn't really matter, there was no interpreted inline-C-for HTML html preprocessor without smashable stacks by default.
Coming from the embedded world and C/C++, I think you're forgetting how much discipline you need to write in C or C++. Most people can't do it without a serious learning curve coming from PHP or Javascript.
Re: (Score:2)
Yes, PHP is easy to write, therefore it is easy to write badly. WordPress is the poster child for PHP's bad reputation, because:
Granted, PHP is the only language where a result like WP is possible. Shitty code hyped by an army of self-described "developers" who proudly and incestuously pass around bad practices like STDs.
That being said, JavaScript outsi