PHP: A fractal of bad design (2012)
eev.ee
eev.ee
Is it like C++, in the sense that there are still a lot of footguns but people who invest the time to know where they are grow to like the language? Or have they actively removed the bad APIs in recent versions?
The fact that it's a pretty poor language under the hood was irrelevant, because almost anyone could pick it up and intuit how its (crummy) built-in templating worked well enough to get the job done.
Its popularity was largely rooted in how easy it made it to Get Shit Done.
Sure, there were near-apocalypse level footguns everywhere in the first four major versions, but those didn't get noticed until the project had been mostly-working in prod for months.
It got first mover advantage due to that, and that sort of lead dies off very, very slowly.
These days PHP has mostly evolved into Java-lite, with some pretty decent frameworks and tools to keep you far from the footguns lying all around due to backwards compatibility, and CLI tooling to pre-emptively warn you when you've stepped on one (not unlike ESLint or TypeScript, really, which are both projects to make using JS less dangerous).
At least, that was the state of things last I looked. I haven't touched PHP in probably two years now.
Of all the languages I've worked in, it's my least favorite. Well, it's neck and neck with Java.
"Recent" here means roughly "from within the last eight years".
That said, there are many, many ancient PHP codebase out there that depend on all the worst features of ancient versions and are not going to get fixed any time soon.
The fact that things can be done sanely now doesn't really fix the decades where they couldn't.
Performance is also no longer a significant issue. Facebook, PornHub, Wikipedia, Etsy, Slack, and more are still happily ticking on PHP codebases.
…and you consider that a good thing???
public $string = “Hello”
Now you can do things like:
public ?string $string = null;
public function appendToString (?string $append) : string {