3 ms·
> You can write a single PHP file that includes HTML, Javascript, MySQL, CSS and PHP, but that would make you a bad developer, or it's such a simple one-off thi
by Legion 14y ago
> You can write a single PHP file that includes HTML, Javascript, MySQL, CSS and PHP, but that would make you a bad developer, or it's such a simple one-off thing that you don't worry about it.
Tools facilitate workflows. The fact is, PHP very strongly facilitates your "bad developer" path. That's why there is so much PHP code that goes down that path, compared to other languages.
Yes, you can go off on a better path. But better designed tools make it much more easy and natural to do things the "right" way.
PHP makes your "bad developer" path the path of least resistance. That's bad.
- BlackAura 14y agoThis isn't unique to PHP, by any means. Visual Basic was much the same, even in later versions where you actually could write well designed code if you knew what you were doing. The IDE, documentation and design of the language encouraged you to make bad design decisions, much like PHP. .Net languages aren't immune to this either, particularly Windows.Forms and ASP.net. To write decent code in those, you basically have to fight the IDE and the framework every step of the way. ASP.net MVC makes it much easier to write good code, at the cost of being harder to user if you don't already know what to do. Your average newbie can't just point and click until he's half way there. PHP has decent frameworks, like Symfony. They make it much easier to do the right thing, and harder to do the wrong thing, at the cost of being more difficult to learn. Props to the Symfony team though. They're still trying to make something good out of PHP long after most other decent developers abandoned the platform on favour of something less newbie-driven. It helps a lot to have that kind of framework available, just in case I have to use PHP for something. Edit: Accidentally said that ASP.Net MVC encouraged bad code, but meant it encouraged good code.