4 ms·
Recently got a freelance Wordpress job after like 10 years of inactivity in that segment, I was surprised by how good PHP has become. I am hoping that it'll con
by jbirer 3y ago
Recently got a freelance Wordpress job after like 10 years of inactivity in that segment, I was surprised by how good PHP has become. I am hoping that it'll continue in this direction.
- oraetlabora 3y agoIt better be. 77% of websites use PHP.
- loloquwowndueo 3y agoNetcraft confirms it?
- trey-jones 3y agoNo doubt 25% of those are still on PHP 5.6 or older.
- npsomaratna 3y agoI've used PHP since the early 2000's (I started with PHP 4, I think). The language has improved vastly since then. When combined with the Laravel framework, you've got a first-class platform for building web applications.
- wouldbecouldbe 3y agoThe point of php was to not be ”good”, but to be practical. A simple way to add some logic to html. Write a few lines, upload it, boom it works. Quick and easy. There is a place for typed & strict languages and a place for pragmatic ones. But php got shamed for it so badly they got into an identity crisis, for the last decade it’s slowly been trying to become Java and do everything correct. Same with Wordpress, before I could just make a plug-in with one php file & a few lines. Now I have to create a separate npm project and build for every tiny change
- Timon3 3y agoPHP got shamed for these things because people built complex, and over time unmaintainable, systems in it. Mind you, the "old ways" still work - you can still write a few lines, upload it, boom it works. Projects around PHP might have developed different ways of working, but that's because of problems in the old way - and that's not a fault of PHP, it's a plus that things move in a more maintainable and type-safe direction. You even reap some benefits when doing a "write a few lines, upload it, boom it works" workflow.
- wouldbecouldbe 3y agoYeah it's great that it still works, and should! That's not to say PHP isn't been overcomplicating itself & hasn't fully embraced why it's so succesfull and improved that part: it's easy & practical. How can it be even easier? For instance even simpler hosting? With things like vercel, and app engine PHP isn't necessarily the simplest choice in hosting sites anymore. A Vercel for PHP would be awesome.
- Timon3 3y ago> That's not to say PHP isn't been overcomplicating itself & hasn't fully embraced why it's so succesfull and improved that part: it's easy & practical. Do you have specific examples for things where PHP has been overcomplicating itself? Most complex things seem to actually make things easier for newbies (e.g. typing can be a great help).
- tommek4077 3y agoAnd as a legacy dev you can just ignore all of those new things. You do not have to use lavarel or any of the latest, greatest frameworks or features. Your code from 15years ago will just work as well.
- delfinom 3y ago>PHP got shamed for these things because people built complex, and over time unmaintainable, systems in it. Because it was very accessible for people to get into it without being you know, a 10 year programming veteran at least. Now all those newbies are out creating 400 npm dependency projects heh
- zztop44 3y agoYou can still make a Wordpress plugin with one php file and a few lines? If you want an npm project and build chain you can have that, but you can absolutely still build a Wordpress plugin with a functions.php file and nothing else
- wouldbecouldbe 3y agoThe old way yes, but if you want to integrate with a block them you can't. The Gutenberg thing is overcomplicated, which is why it's not really taking off.
- lurkerforawhile 3y agoGutenberg has been a nightmare from the beginning. Saving structured data into the post HTML field severely limited the benefits of migrating content into blocks. Last time I checked, getting block data via the REST API wasn't officially supported, so making a headless site requires extra plugins. When you reach that point you may as well be using ACF, as it's so much simpler and doesn't require rebuilding frontend scripts anytime anything changes.
- tialaramex 3y ago> But php got shamed for it so badly they got into an identity crisis, for the last decade it’s slowly been trying to become Java and do everything correct. PHP was a dumpster fire. It's not "pragmatic" to have trivial SQL injections everywhere that are difficult for non-experts to fix. It isn't "pragmatic" to have user hostile error messages. It isn't "pragmatic" for different parts of your standard library to disagree about core design principles. It's a hundred different recipes from around the globe just thrown into a blender for a few seconds in the hope the result will be "fusion cuisine" when it's barely even food. I wrote a whole bunch of PHP ~15 years ago for money, and before that I wrote some for the comedy site friends and I ran in the 1990s, I also had the misfortune of picking up a card in my scrum the other month where I had to modify some PHP. It's changed. It hasn't changed anywhere near enough to justify itself. I would rate PHP3 era PHP as a 0/10 maybe just use static HTML instead, and modern PHP is maybe 3/10 where it's better but it's just not better enough to use if you could pick something else.
- unflxw 3y agoThere's no rule that says that something can't be both practical and good. And it's not like it's no longer possible to write quote-unquote "bad" PHP -- if nothing else, PHP is backwards-compatible to a fault.