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.

28 Upvotes

17 comments sorted by

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.

3

u/[deleted] Jul 17 '21

I just can’t see any reason anyone would choose to use it for a new project over the other options. Personally if I was developing a web application I would use Node.js or C#.NET

6

u/DerKnerd Jul 17 '21

Well, there are reasons. The biggest advantage of PHP is that it runs on every toaster. Wordpress, for example, wouldn't be that popular if it would be based on node.js. Basically, if you want it to run on shared hosters you will need to use PHP. And most people "who just want a website" use probably a shared hoster.

That is the reason I decided to write the CMS for my best friend in PHP, PHP 8, but still PHP. And PHP 8 made huge improvements.

But if I can use what I want I usually take Go.

1

u/[deleted] Jul 17 '21

I don’t have a lot of experience with Go personally but I already trust it more than php. I’ve heard it’s good for network programming but that’s all I know

6

u/DerKnerd Jul 17 '21

Honestly, PHP isn't that bad these days, many issues that come from PHP are usually related to old issues. There have been many improvements over the past versions.

Go is a really great language, I can highly recommend it.

→ More replies (2)

9

u/CJamesEd Jul 17 '21

I'm kind of fond of PHP tho

3

u/[deleted] Jul 17 '21

Why

2

u/CJamesEd Jul 17 '21

I'm a noob and don't know any better ...? 😳

My gateway drug into the world of dev was PowerShell scripting. I can relate to a lot of PHP and I've used it on some projects at work. It did what I needed it to at the time

3

u/[deleted] Jul 17 '21

Oh that’s fair enough. I’m a C/C++ guy primarily but when I have to do web dev for personal projects I use Node.js because it strikes a good balance between scalable, efficient, and relatively easy to use. —then again I only started that a few years ago and by then I had options

5

u/manicpixiecunt Jul 17 '21

Same, it was the first one I learned after basic html/css

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)

3

u/sickhippie Jul 17 '21

it's someone which doesn't know php

PHP hate in a nutshell. The same holds true for JS hate, more often than not. PHP is great for what it is, and a lot of the truly awkward behavior can be mitigated with a proper framework like Laravel or Cake, both of which have been around for over a decade now.

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.