Log in

View Full Version : PHP: a fractal of bad design



Tomm
08-06-2012, 11:17 PM
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

Recommended reading. Note, I've worked with PHP for over 7 years so don't think I'm hating on PHP without ever using it myself.

Pegle
09-06-2012, 08:44 AM
His analogy made me laugh :')

But like he said, it still works somehow and people build quite good things with it.

Dentafrice
12-06-2012, 01:16 AM
I actually read this the other day when it was posted on Hacker News. I agree with it, and like you Tomm, we both have used PHP for quite a number of years... yet I look back on it and see many of the faults that I never saw before.

Agnostic Bear
15-06-2012, 06:42 PM
Best comment taken from that site:


Blah blah blah. Aren't we old enough to finally stop ranting about how "bad" PHP is? There are already more articles out there about this topic than we need.

One thing I can't understand is why people like you are ever bothering with crap like PHP if you hate it so much (a non-hater wouldn't have written a post like this)? Use some other superior, or "better" for that matter, language, like Python or Ruby if PHP is that bad. No language will be ever perfect. C, C++, Java, etc. they all have their shortcomings. You just have to dig a bit deeper to find them.

PHP is good for what it is. It was never intended to be what it is now (a major web development language) hence it's maybe not as structured or as shiny as you would like but there must be a reason why there are so many people using it.

Having been a PHP dev for around 8 years, I do agree with most of your points but, let's be honest - you haven't said anything we didn't know. My advice is - don't like it, don't use it. No one's forcing you into using it.

Dentafrice
15-06-2012, 06:52 PM
PHP is good for what it is. It was never intended to be what it is now (a major web development language) hence it's maybe not as structured or as shiny as you would like but there must be a reason why there are so many people using it.

This seems like just an excuse. PHP was never intended to be a major web development language? Err... maybe not major, but that's exactly what it was intended to be.

It was never intended to have CLI capabilities nor be involved in standalone desktop applications, but it evolved to be that. So yes, for those purposes it is "good for what it is".

I agree with the first half of that paragraph, don't bother with it if you hate it so much... but the excuse that poster gave is completely wrong.

Chippiewill
15-06-2012, 07:31 PM
Err... maybe not major, but that's exactly what it was intended to be.
It wasn't designed to build shopping carts, forums, encyclopaedias or any large-scale site, it was designed initially as macros for personal homepages not to communicate with databases, maintain sessions or be used for intricate scripts. Hardly a full web development language.

Dentafrice
15-06-2012, 07:38 PM
"PHP Tools" was not designed to do any of that, but if you'll notice PHP Tools is not the same as PHP. PHP Tools didn't even have basic working functionality such as good working loops. Now, what we consider PHP today was designed for all of this, the "real" PHP started with PHP3 when it was completely rewritten to support all these features which established it as a different product altogether from the original "PHP Tools".

So you're right and wrong. You're correct in the sense that PHP Tools was not designed to do any of that, but PHP actually was.

Chippiewill
15-06-2012, 07:42 PM
And the relics of the syntax lived on regardless because they wanted it to be a sequel and essentially it was built on the pre-existing foundation of it being an easy language. It might have been a recode but it certainly was not a redefinement of the principle.

Dentafrice
15-06-2012, 07:46 PM
We're not arguing syntax here, we're arguing what the language was designed for and it seems that you can't handle being proven wrong. The language was designed for those things that you said that it wasn't designed for.

So instead of just acknowledging that you are wrong, you change to a completely different stance on syntax... you have a lot to learn kid.

Chippiewill
15-06-2012, 08:54 PM
The language was designed for those things that you said that it wasn't designed for.
No, the language was designed to be easy to get into. The uses of the language in a good way were ultimately a secondary objective as is shown by the overly flexible nature of PHP. The result? A sub-par language with many inadequacies because they were too busy trying to please people who don't want to do things properly.

Don't want to indent? Who cares, just stick it all on one line if you want.
Don't want to use brackets on if statements and stuff it all on one line? Go ahead, it might hurt readability and cause issues when expanding if statements into multiple lines but we don't want stuff breaking more than it needs to.
Undefined variable? Make a cute little error and keep on going like nothing happened, no need to upset the programmer.

PHP was designed to keep on chugging on at all costs FIRST, web development SECOND leading people to learn bad practices and just disable error reporting when they can't be bothered to fix a minor error.


So instead of just acknowledging that you are wrong, you change to a completely different stance on syntax... you have a lot to learn kid.
And what's with the ******* attitude recently anyway? You think because you work in the business for real now you suddenly get to decide who's right and who's wrong about stuff? Get a grip and stop insulting anyone who's trying to make a start around this place because you used to be a positive influence here, I can't say much to that recently with hurtful put-downs and non-constructive feedback. Half the posts you've made in technology discussion have been flaunting about the fact you have a job and the ones in here have all been about how you're so professional and have such a fantastic work ethic that you can't be doubted. Fact is I don't have to respect or even acknowledge your opinion and I doubt I will any-more until you quit being so condescending. You're hardly the only web developer and you're far from the best.

Dentafrice
15-06-2012, 09:04 PM
No, the language was designed to be easy to get into. The uses of the language in a good way were ultimately a secondary objective as is shown by the overly flexible nature of PHP. The result? A sub-par language with many inadequacies because they were too busy trying to please people who don't want to do things properly.

Don't want to indent? Who cares, just stick it all on one line if you want.
Don't want to use brackets on if statements and stuff it all on one line? Go ahead, it might hurt readability and cause issues when expanding if statements into multiple lines but we don't want stuff breaking more than it needs to.
Undefined variable? Make a cute little error and keep on going like nothing happened, no need to upset the programmer.

PHP was designed to keep on chugging on at all costs FIRST, web development SECOND leading people to learn bad practices and just disable error reporting when they can't be bothered to fix a minor error.

Haha, even funnier. You now are going from what PHP is designed for architecture and feature wise, to the semantics of what you think it was designed for usage wise on a personal level. Dude... give up... you're wrong. You're making yourself look like a fool, especially with comments such as these:


A sub-par language with many inadequacies because they were too busy trying to please people who don't want to do things properly.

What is properly? Are you the definition of proper? Do you have the knowledge to say that PHP is not acceptable because you know what's proper? I don't think so.



And what's with the ******* attitude recently anyway? You think because you work in the business for real now you suddenly get to decide who's right and who's wrong about stuff? Get a grip and stop insulting anyone who's trying to make a start around this place because you used to be a positive influence here, I can't say much to that recently with hurtful put-downs and non-constructive feedback. Half the posts you've made in technology discussion have been flaunting about the fact you have a job and the ones in here have all been about how you're so professional and have such a fantastic work ethic that you can't be doubted. Fact is I don't have to respect or even acknowledge your opinion and I doubt I will any-more until you quit being so condescending. You're hardly the only web developer and you're far from the best.

I never said I was the best, and I never said I was the only. Quit putting words in my mouth. It's obvious you never paid attention to my posts in the past, I've always had an attitude. Anyone from D&D (56ers) will know that. It's definitely not recently. You may just have noticed that as I've posted more recently than I have in the past two years. Definitely not new.

I have not flaunted one bit. You seem to like to bring up issues that you've found on Google that you have no idea about (37signals incident). In fact, in the thread yesterday I never once mentioned "how professional I am, and how I have such a fantastic work ethic".. in fact.. I never once said I was professional nor had a great work ethic.. all I said was what happened to the company prior to me having responsibility was not a measurable factor on my work ethic. Again, quit putting words into my mouth.


Fact is I don't have to respect or even acknowledge your opinion and I doubt I will any-more until you quit being so condescending.

Nope, your certainly don't. Never said you did. You're the one attacking my posts. My initial post on this thread was not targeted to you, nor was my second. You quoted me and "attempted" to be right, and it didn't work. If you don't want my attitude, don't pick a fight... but if you pick a fight with someone, prepare to accept someone with an attitude because that's how I operate. Don't like it, don't pick a fight.

Chippiewill
15-06-2012, 09:07 PM
Nope, your certainly don't. Never said you did. You're the one attacking my posts. My initial post on this thread was not targeted to you, nor was my second. You quoted me and "attempted" to be right, and it didn't work. If you don't want my attitude, don't pick a fight... but if you pick a fight with someone, prepare to accept someone with an attitude because that's how I operate. Don't like it, don't pick a fight.There's a difference between having a debate and making a declaration that you're the one that's right.

Want to hide these adverts? Register an account for free!