PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
21–30 of 61 posts
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#22Earlier quoted context omitted.
When's the last time PHP has been used in this way? Don't people use frameworks these days such as symfony, silex and laravel etc? And then point the web server to the entry point like with any other language?
>Don't people use frameworks these days such as symfony, silex and laravel etc People should , Composer (with PSR autoloading) and nikic's FastRoute get you most of the way to a really nice, lightweight meta-framework barring anything else, for practically nothing. There really is no excuse for the "URL points to a file" model to be a thing anymore. But a lot of legacy PHP code doesn't do that, and likely a lot of ne…
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#23Earlier quoted context omitted.
>Don't people use frameworks these days such as symfony, silex and laravel etc People should , Composer (with PSR autoloading) and nikic's FastRoute get you most of the way to a really nice, lightweight meta-framework barring anything else, for practically nothing. There really is no excuse for the "URL points to a file" model to be a thing anymore. But a lot of legacy PHP code doesn't do that, and likely a lot of ne…
Honest/naive question: why not? Plenty of mvp or weekend projects can get by easily with url=page. If it's faster and simpler, what's wrong with doing it? Surely there's room for both on the intetnet.
If it's just a small brochure site with a few pages then it's no problem, but forums and larger projects built like this can leak information and expose vulnerabilities when PHP files which weren't meant to be directly accessed are, such as pages that perform SQL queries expecting variables in context that don't exist when accessed directly, or old config files, text files, open directories, etc.
But "url=page" is still basically routing using the query string, and IMHO so is access control using .htaccess. Any system where URLs are validated and where they don't directly point to files on the server counts.
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#24#1 reason the article doesn't mention: It's incredibly cheap to host PHP. Hosting companies push WordPress and other PHP-based hosting heavily and make it super easy for anyone to get a live site going with PHP. Last time I launched a node app, it took me a full day of messing about in AWS. Last time I launched a PHP app, it took me less than a half hour at Siteground.
TBH, PHP is viable for pretty much exactly as long as Wordpress survives and uses it. If that changed, I wouldn't fancy PHPs chances.
I do concede that if PHP went away, WP would somehow survive, like some kind of post-nuclear cockroach.
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#25I can't take this article seriously when it shows a survey at the top claiming to show a stack overflow developer survey for back-end technologies that lists Javascript at 54% happiness, and then further down it lists nodeJS at 14% happiness. I guess the other 41% were using io.js. Apparently people are also happier using angular on the back-end. Which makes no sense. Also, pretty sure WP still runs PHP on the back-e…
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#26Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#27Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#28Earlier quoted context omitted.
> in your terminal You just lost a nontrivial percentage of PHP developers. Far and away the most compelling feature of PHP for a lot of their target audience is that the deploy model is "unzip this file in that folder". If I want to host my own web site but I don't want to "learn to program" there is no alternative.
> unzip this file in that folder it's more like "copy these files via ftp to this host" (p.s. that also includes your config.php with plain text passwords of course)
I got fed up with this a few years ago and started building http://bitmash.io (yes, shameless plug) which does some fancy filesystem manipulation to swap out the application's files during upgrades while otherwise looking like a perfectly ordinary PHP hosting provider. While I'm proud of this solution it still seems rather silly to have to jump through these sorts of hoops to handle deploys.
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#29There's still people working on Visual Basic 6 as well. That doesn't mean there are no viable alternatives.
Indeed from the last 6 years, companies are more willing to try out new technologies, like node, or even docker! But only places that can truly develop decoupled from the technology already used can jump on board for these things. The transition cost for adding other technology when decoupled is magnitudes lower than migrating an existing functioning production proven product.
I have my own opinion on NodeJS, but I give it credit for the tooling it has outside of production server uses.
Re: PHP vs Node js... Let's be honest: Node.js couldn't kill PHP. Why?
#30Earlier quoted context omitted.
>Don't people use frameworks these days such as symfony, silex and laravel etc People should , Composer (with PSR autoloading) and nikic's FastRoute get you most of the way to a really nice, lightweight meta-framework barring anything else, for practically nothing. There really is no excuse for the "URL points to a file" model to be a thing anymore. But a lot of legacy PHP code doesn't do that, and likely a lot of ne…
Honest/naive question: why not? Plenty of mvp or weekend projects can get by easily with url=page. If it's faster and simpler, what's wrong with doing it? Surely there's room for both on the intetnet.
sure, if you're writing "Hello world", /index.php is great. For everything else? Not so much.
This reminds me of people saying "version control, that's too hard, I'll just make backups of the src dir regularly".