7 ms·
One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to fi
by Gigachad 5y ago
One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off".
I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.
- mschuster91 5y agoWhich ones would that have been? Perl? Python? Java? JavaScript? Among that choice set, PHP is definitely the best contender.
- Gigachad 5y agoI would say that Ruby on Rails is a pretty good candidate to completely replace PHP with.
- gremlinsinc 5y agodoes rails come with a generator to create a teams based multi tenant SaaS app with authorization and authentication and job queues without extra setup? (ie without decide and sidekick?)... can rails compete with the performance of octane using swoole with 8k reqs per sec? rails is the first framework I ever learned in 2012 but I kept jumping back and forth until laravel basically started lapping rails in terms of baked in goodies.
- Gigachad 5y agoI’m not sure why this really matters. You can set all of that up in rails in under an hour. And almost every company uses exactly the same libraries for it all. It’s been so long since I even created a rails app because it’s almost always already created when you start the job.
- nucleardog 5y agoI think you (and to be fair, many people) are missing a huge part of why PHP is still popular. Saying Ruby can replace PHP sounds to me like saying that Ruby can replace Excel. It's fundamentally misunderstanding _why_ it's popular in the first place. I have a HTML page. How do I add a hit counter to it with Ruby? I can do it right now in PHP with zero dependencies and it'll fit in this comment: <html><body> <p>You are visitor number: <?php $count = file_get_contents('hit_count.txt'); $count = $count + 1; file_put_contents('hit_count.txt', $count); echo $count; ?> </p> </body></html> Is it shit? Yep. Does it (mostly) work? Yep. When you want to do something, you can just copy and paste a handful of lines of PHP into a file and rename it from .html to .php and it'll basically work anywhere. You don't need to worry about frameworks or anything. Routing is handled by the web server. Hosting is handled by someone else. Deploying is just FTP'ing a .php file off to a server somewhere and then requesting it. But when you are ready to get into "real" programming, that's all there too. PHP has a true learning _curve_. Every bit of complexity is only a small step from the previous. Getting started does not require a ton of background or knowledge. You can start out copying and pasting some code into the middle of some HTML and a year later end up working within once of the nicer, more comprehensive frameworks managing your dependencies with a relatively decent package manager... and still hosting it all on your $3/mo shared hosting. If every professional developer stopped using PHP tomorrow, we'd still end up back exactly where we are as a bunch of people found PHP as the most accessible and direct solution to the problem they have.
- Gigachad 5y agoThis example seems to be a great demo of why people do not like working with PHP. PHP makes the shit method the massively simpler way and the good method much harder. Now you open yourself up to risks like what happens if we accidentally let some user input change the file opened as well as the content written. While with rails, to do basically anything, you already have a full db ready and incrementing a counter using the ORM is even easier than opening a text file. So people avoid PHP because it most likely involves dealing with absolute crap code written with no understanding.
- wbercx 5y ago
- ipaddr 5y agoThere isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? When I started with php in 2001 those elite programmers at meetups were looking down at php because Java was cool. In 2003 those elite programmers thought php should die because asp took over. PHP kept going along quietly taking over the web until the facebook movie came out making PHP cool for a moment. Those elite programmers decided PHP was too mainstream and the why PHP sucked movement started. The elite guys moved to Ruby On Rails then node/MongoDB, angularjs, React, Nextjs leaving each ecosystem for the next hoping that one day they will strike gold.
- 0x0nyandesu 5y agoI've been working with php since 2001 and that whole time I've been cleaning up bad ruby and nodejs and PHP implementations and knowing JavaScript well enough to code in whatever front end nonsense comes out from PrototypeJS to jQuery to ExtJs to angular to react on and on ad nauseaum. Throughout PHP was my actual workhouse. It's kinda frustrating when I meet someone super into JavaScript as a backend because I still choose PHP even though I have 20 years of JavaScript under my belt and love Es2015+ promisable JavaScript. I'm not even really sure why python is so popular for DevOps cause I do everything in php and it's unit tested and works well with reproducible results.
- commanderkeen08 5y agoHonest question: what are people using if not PHP? Node? Python? The 80% of us who aren’t FAANG and are writing CRUD apps. I’ve tried researching the pros/cons and all I get are low quality listicles. Nobody can tell me why PHP is “bad” or what Python does that PHP can’t. Inconsistent params are the only argument I’ve heard. Which my IDE solves. What about JavaScript splice vs slice. I look it up every time.
- emodendroket 5y ago
- jonwinstanley 5y agoDoubt there was a chance to “kill it off”, doesn’t it run over 50% of all websites?
- Gigachad 5y agoPHP powers a couple of the software packages used by over 50% of websites. Mainly being Wordpress. Impossible to know but I would guess that new development of PHP sites is not such an impressive stat.
- adventured 5y agoIt's a CRUD staple. There's no other language so well suited to easily building CRUD services (of which WordPress is one). It's a big cherry on top that the language has gotten better and dramatically faster over the last several years. There was no chance of it being killed off rapidly as the author was perhaps implying. It might have slowly rotted away, had the maintainers not stepped up with v7 and hit a home run.
- oblio 5y agoPHP runs the long tail of the internet. And somewhat accidentally, it also runs Facebook :-D
- gremlinsinc 5y agoother than Phoenix framework maybe are there any others with as much included as laravel has? caching, jobs, docker via sail, authentication and authorization, one command to have a full multi team/tenant SaaS app template via jet stream. even rails doesn't have this, as you need to choose your own implementation for auth and access control, something like sidekick for job queue etc.... plus the ecosystem. I've tried so hard to like other frameworks and some I really do (like remix.run) but the lack of real momentum and community hurts most anything else and just doing everything as serverless micro services isn't always preferred or using micro frameworks. I'm excited for the new features and with octane you can get more reqs per second than Phoenix framework which should make it easier to scale apps with less resources.
- bGl2YW5j 5y ago.NET has most of this. Love it.