4 ms·
I detest PHP, and have been lucky enough to mostly avoid working with it. But I'm currently leading the development to convert an 80k line PHP app to Rails, and
by korch 17y ago
I detest PHP, and have been lucky enough to mostly avoid working with it. But I'm currently leading the development to convert an 80k line PHP app to Rails, and I'm absolutely shocked at how fundamentally flawed PHP code is from the perspective of general best practices in software and web development and also computer science. PHP code is so bad that it deserves it's own section on dailywtf.com.
I think PHP has been successful because it's the Visual Basic of the web. Just like in the 90's with the programmer "holy war" between Visual Basic "developers" versus everyone else(C++ mostly). At that time the number of "pseudo-developers" dwarfed the number of "real" developers, and so Visual Basic ended up being used for all kinds of stuff, in companies all over the land, and for all kinds of software for which it was totally inappropriate.
It was termed "Virus Building" for good reason, and not just because M$ software was so exploitable. With Microsoft dominating the desktop, they were able to embed Visual Basic everywhere. It's the oldest trick in the book: if you can be the distribution platform, your default tool set will end up being the most used simply because people are too incapable and lazy to tweak and customize software themselves. To paraphrase Steve Jobs' remark about people reading: "people don't tweak anymore".
There's been a similar demographic split on the web for the past decade. The number of web developers who know nothing about software engineering in general dwarfs those who know best practices, computer science and stuff like that. Add in the sweet spot of the entire hosting industry defaulting to Apache and the LAMP stack, PHP got to be the default tool, like Visual Basic on Windows desktops. It's totally impossible to "win" against these kinds of numbers--we can only wait for the platform to change, then PHP will be dead, just like how Visual Basic is now "dead".
Perhaps the whole "cloud computing" hoopla and mass move to VPS will pull the rug out from under PHP in the next 2 years.
- eru 17y ago> It's totally impossible to "win" against these kinds of numbers Just redefine "win": Not using the same stupid stuff as everyone else can be a competitive advantage.
- NathanKP 17y ago"I'm absolutely shocked at how fundamentally flawed PHP code is from the perspective of general best practices in software and web development and also computer science. PHP code is so bad that it deserves it's own section on dailywtf.com." I assume that your 80k line app must have been written very poorly. Like any other good language PHP can be misused to create horrifying spaghetti code. That doesn't mean the language is no good.
- pyman 17y agoWait for the platform to change? It already did. It's now FOSS and it's called LAMP. You ignorant basterd ;)