3 ms·
I don't dispute that people will write bad code in any language. The problem I have with PHP is that it at best, makes it exceedingly easy to write bad code, an
by mistercow 13y ago
I don't dispute that people will write bad code in any language. The problem I have with PHP is that it at best, makes it exceedingly easy to write bad code, and at worst has actually encouraged it (see, for example, magic quotes).
I also am not claiming that PHP offers no advantages. Certainly it has some good things about it. The choice to allow you to easily interleave PHP code with HTML is an example of a simple feature which makes life really easy when you're setting up a site.
But rewriting in a better language is not necessarily a viable option. It's generally not the call of the person tasked with maintaining it, and even if it is, "cost will amortize quickly" isn't necessarily good enough on a large project with limited funding.
- jtreminio 13y ago> actually encouraged it (see, for example, magic quotes). Actively discouraged for years, and removed completely over a year and a half ago.
- mistercow 13y agoYes I know, I was just pulling out a random example that came to mind. Still, you'll find a lot of code out there running on old versions of PHP with magic quotes enabled. And that's another part of the problem: the incorporation of really bad ideas that end up poisoning code bases for years to come, simply because they weren't properly vetted before being released.