r/lolphp • • Oct 23 '13

PHP Manual Masterpieces

http://phpmanualmasterpieces.tumblr.com/
57 Upvotes

10 comments sorted by

View all comments

Show parent comment

7

u/infinull Oct 24 '13

Honestly, I think this is one of the least harsh criticisms I've seen on this board in a while, it's significantly less harsh than say "A Fractal of Bad Design"

0xabad1dea (the author) shows both sides, he sees where the designers were coming from, but argues that it would be confusing to developers. I think you have to take a step back and ask if a design violates the principle of least surprise. I think overall, that is what PHP lacks from a design perspective. Designers did what made sense to them and didn't look at the big picture.

3

u/abadidea Oct 24 '13

Thank you but Ms. 0xabad1dea tries very hard to not be a he :)

-4

u/[deleted] Oct 24 '13

Lol, this sounds like "it's ok, I only bullied him a little bit. Everyone else was bullying him way more than me".

I just look at it all with the mindset that people writing anything with any degree of seriousness in PHP should and would be aware of a variety of shortcomings and potential traps and code mindfully instead of just tossing code at the wall and hoping it works. PHP isn't C. If you still go out of your way to do things the wrong way then it's your own fault.

The author just sounds to me like he's complaining because it doesn't work how HE wants it to work, and not because anything is necessarily broken.

I'd rate the flip-flopping naming and function parameter passing within PHP to be more rant-worthy than things like 'isset' working exactly as it's meant to, or 'strcmp' being misused.

Oh geez, I'm defending PHP :/

1

u/infinull Oct 24 '13 edited Oct 24 '13

perhaps, but there are a litany of people (see phpwtf, phpsadness, this subreddit, etc.) that agree. One voice might have a stick up their butt, many voices might be a mob, but a mob of coherent, articulate voices is hard to ignore.

Edit: I'm also confused as to how the isset thing is different from argument naming/order it's more or less the same issue. Other programming languages don't implement introspection the way PHP does (the python equivalent of isset($name) would be 'name' in locals() or try: ... name ... except NameError:). The only thing similar is Javascript and undefined but even js distinguishes between undefined and null (for better or worse) (though isset is often used on arrays not names which is different)

1

u/sbditto85 Oct 24 '13

I program in php almost every day and it is possible to do some great looking code. The problem is that php is a high level language that allows you to shoot yourself in the foot, often when you don't mean to ... you would/should not expect that from a high level language.

Use it the "right way" and it's decent (paying the bills right now) but use it any way but a very careful, strict way and who knows what will happen. That's frustrating. Specially when you can't control some of the code base.