r/ProgrammerHumor • • Jul 17 '21
Meme Found this spectacular quote on why PHP is the worst
All credit for this excerpt goes to: Evelyn Woods of https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/#an-analogy
I can’t even say what’s wrong with PHP, because — okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there. You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes. You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways. You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever. And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools. Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door. That’s what’s wrong with PHP.
10
u/DerKnerd Jul 17 '21
I do like a good PHP rant like everyone else, but I am really wondering how much of that still holds true with PHP 8.
9
u/CJamesEd Jul 17 '21
I'm kind of fond of PHP tho
3
u/[deleted] Jul 17 '21
I kind of hate this kind of blog. It seem that the author made enough research to find option but excluded ths options that would be a counter argument.
For fopen, we have 5 or 6 options including debug option that you set depending on your need (dev/prod). Like if you suppress error message, you can still ask php to throw them for debug.
But for json decode, the option throw exception on error is forgotten...
From what i read, it's someone which doesn't know php and maybe any language that wrote that. If you doesn't know how to use a tool, it's not the tool fault.
Yes php is not perfect, without my ide i would have more troubles, but i don't know any language that doesn't have some small troubles.
(For background : 5y of c++ and 10y of php mainly)
1
u/[deleted] Jul 17 '21
I think that's too extreme. During the past 20 years, I've used "real" languages, incl. C++ or C# and Java. PHP was the first when i started with webdev, and i still like it. It enables extreme fast development, although i switched to Go last year.
1
u/personalityson Jul 19 '21
I keep hearing that PHP has inconsistent function naming, order of variables etc. How is this ever important? I never remember any of that and have to look up every function every time
1
u/avenue-dev Jul 19 '21
PHP is shit, and you should not be using it, period.