by brendt_gd · 6y ago · 0 comments
Being a PHP programmer, I can concur: https://stitcher.io/blog/php-in-2020
You can, but in my experience, most people don't. Especially in Wordpress land. I've paid for plugins with egregious problems that "work okay" because error reporting is silenced.
> if you want to, you can write modern and clean PHP code, and leave behind much of the mess it was 10 years ago.
But most people haven't, and I'm not really interested in spending my career and hobby time playing Russian Roulette with coworkers and collaborators.
The same argument can be said of all languages.
It's true with PHP because the language is popular.
It's true with Java, because the language is pop^Wthe holy grail of entreprise software language.
Having seen both worlds in small and large corporate settings (and others, in Ruby, Python, C, Perl), I somehow prefer PHP, because at least, it does not pretend to be "the right thing" for enterprise software.
At least languages like Java and C# require static typing (though I'm sure there's some lazy sociopath out there writing C# with every single variable as a dynamic), PHP doesn't even have that minimum bar
The one with System.ServiceModel.Install.Configuration.ServiceModelConfigurationSectionGroupCollection in it surely musts be awesome too; I've heard great things about it.
The footguns in a given language being more ornate and towering than in another doesn't make that language better, but the ability to produce resilient, maintainable solutions for a given problem space in it.
And Java having a good one is no protection against the development cultures of large (consulting or non-tech) companies where the main metric is not the performance of the software neither the frugality of the hardware it runs on.
PHP doesn't have this accidental monopoly: you can use a language that doesn't require discipline and tooling to make something decent.
Bottom line, PHP is better than it used to be. But the technical debt remains, and it's easy to avoid if you can, so we do.
I started with PHP, but I have no reason to go back to it. It has no benefit and is worth it only if you have already a massive PHP code base, or a pool of PHP devs you need to employ.
No. But it can be helped with a tech lead/team lead who can kindly but ruthlessly enforce good coding practices. I was lucky to have one of those when I was learning Java, and a lot of the habits they've taught me ended up being pretty universal, and I owe them a great deal of gratitude.
And yes, Javascript has similar problems, but much less severe.
I do think that one of the big problems for PHP is that people who voluntarily do PHP instead of something else are immediately suspect. Why aren't they interested in learning something else? Do they not really care about code quality? Do they just say 'good enough' and only give a half-assed effort?
Modern PHP is fine, comparable to other dynamic languages but with some ugly weird bits (`empty`). However, most PHP I run into is not modern. It's leftover code from the 00s that has huge security holes that no one has noticed yet. If someone wants to make a new project with Laravel or Craft CMS, I wouldn't stand in their way, but I can't really imagine doing it myself just because of all the flashbacks to code that parses query parameters and calls the database in the middle of a templated for loop…
Part of the reason is the improvements of Hack over PHP, part of the reason is very aggressive linting (to, e.g., enforce the use of types), and part of it is probably that Facebook doesn't hire for "PHP positions", but for generalist software engineers.
Our stack at the time was transitioning to .NET Core, but the HR posting was some generic one (I believe for a "full-stack dev" with PHP experience).
Got a bizarre range of candidates who had got past the inital filtering, all except one whose PHP amounted to wordpress only experience (some who were not able to clearly differentiate between serverside and clientside state or logic).
Don't want to tar folks with the same brush, but that experience led me to believe the folks who got filtered through for possessing PHP experience, in this case, were extremely bottom of the barrel.
It's also announcing your pay will be way on the low end. At least that's what it means around here.
6. Maybe Monoliths Don't Suck
There really wasn't anything PHP-specific there. My monolithic Java backend restarts much faster than webpack can rebuild my frontend. Complex microservice systems (like Netflix's) make for complicated developer setups in any language.