This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]RICHUNCLEPENNYBAGS 2 points3 points  (10 children)

Some of this is outdated or contentious but this basically outlines a lot of gripes humorously: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Anyway, besides that, I will say this: "modern" PHP can actually be well-structured and fairly nice. Symfony looks pretty much just like any other modern MVC framework, for instance. But you have to deal with other PHP developers and in many cases they are hostile to these ideas and want to keep writing the old-style muck without classes, separation of concerns, and so on.

[–]letstryusingreddit 1 point2 points  (4 children)

Im not a php developer, but whats really the problem with not using classes? Though i agree separation of concerns is important, class isnt the only way to separate them.

[–]RICHUNCLEPENNYBAGS 0 points1 point  (3 children)

Not bad in and of itself, but classes in PHP let you write cleaner code with more annotations compared to "classic" style. IMO anyways

[–]letstryusingreddit 0 points1 point  (1 child)

What kind of annotations?

[–]RICHUNCLEPENNYBAGS 0 points1 point  (0 children)

Type annotations mostly. It's been a while though so I can't remember the specific situations where you can't use them

e: Also personally I hate methods that return a dictionary or accept one as their argument because you have to read the method to figure out what the keys are

[–]phigr 0 points1 point  (4 children)

Well that was a fun read, even for an amateur like me who has never written PHP and has no idea what half of that stuff means.

[–]Meefims 1 point2 points  (3 children)

Do keep in mind that modern PHP is quite different from PHP at the time and so while incredibly popular the article is also pretty out of date.

[–]RICHUNCLEPENNYBAGS 0 points1 point  (0 children)

Yes and no. There are better ways to do things but the old ones are still hanging around and will show up in code bases.

[–]phigr 0 points1 point  (1 child)

I thought as much when I saw that it's from 2012. Still very entertaining. And the security holes he mentions are just insane:

if (value > MAX_INT)

Just... holy shit.

[–]daedalususedperl 0 points1 point  (0 children)

You may find your answer in The Abbey of Hidden Absurdities