At 6/25/08 04:39 PM, different wrote:
PHP was never designed to be a clean framework.
I often wonder if PHP was designed at all. I'm not often so confrontational but pretty much all you said is bollocks. Clean code = more maintainable code. Who the fuck wants to rewrite a whole site whenever a simple change is required?
I am sick and tired of fixing other peoples' shitty, horribly code. Most of the people who write it will, when pressed about it, chuckle and go "oh that's PHP for you; it's not designed to be clean". Yeah? Well why the fuck not? Perhaps you just can't be fucked to learn how to write clean code? Which brings me onto elbekko's post.
The problem (most of the time) isn't that people can't be fucked to write clean, structured code, the problem is that everyone has different ideas of what constitutes it. I know people who will make websites that include 15 files just to make a simple bloody homepage, who insist that is "properly structured". While breaking your code into different modules is nice, there is doing it properly and there is taking the piss.
I know people who will keep all their POST handling in one file (with one huge switch statement, often with really stupid fall throughs), even when it's 500 lines long. And you know what? They insist that's "properly structured". too.
I could give you dozens of examples of such cock ups in "design", (I quote this because very little actual programming design goes into PHP projects, as they're usually commisioned to the cheapest company and the client wants it yesterday) but I'm afraid you'll drift into a coma.
The thing is I'm no exception to this either; I've written some god-awful code in my time. Often in an effort to try and achieve cleaner code, ironically. Any programmer who says that: a) they've never written shit code and b) they're current coding style is perfect is talking out of their arse.
Which is why I think this "properly structured" thing is utter nonsense. Everyone has their own way of getting things done. Which is why I advocate more people learn to use frameworks. With a framework there's a certain way to do things. It makes it so much easier to debug other peoples' code and have more than one person working on a project.
So to summarise:
Dear world;
Stop writiing such shit PHP code. Someone has to look after it when you're done with it, and it's often me. You may wish to take up a framework should you have problems with this simple request.
Yours faithfully:
BoneIdol
I feel oddly better for that. Sorry about the rant everyone, touchy subject for me.