3 ms·
I hate this "I do not fault the language for this". It is the argument always brought up with PHP as well. You can write ugly code with Python, but the Python
by allendoerfer 12y ago
I hate this "I do not fault the language for this". It is the argument always brought up with PHP as well.
You can write ugly code with Python, but the Python language and community clearly renounces itself from that and is all about readable code. Every feature addition or remove is done with consideration of code readability and creating one best practice to perform a task correctly.
JavaScript "maintainers" try their best to build a solid language on top of an ugly hack. The community tries every day to avoid its own language with another precompiler.
Java is all about defining solid interfaces, which creates new problems, but at least they try.
On the other side, Perl people were historically often proud of their crazy hacks.
PHP does not remove dangerous or objectively ugly language features. It could avoid SQL injections in new versions all together but instead is focused more on adoption and backwards compatibility.
The language is partly responsible for the type of code that is written in it.
- nemo 12y ago"PHP does not remove dangerous or objectively ugly language features." I hate to defend PHP, but they have removed some dangerous features. Over the years there have been a lot of dangerous hacks that were deprecated and eventually killed. register_globals was deliberately disabled, breaking a lot of old PHP. Magic quotes got removed (though PHP's morass of variable escaping is still a tar pit). PHP 6 (or maybe 7 depending on the number they decide to go with) will kill mysql in favor of mysqli which will help enforce the use of placeholders/prepared statements (you can still screw it up, but you have to work harder). They could do better, but they have been improving in removing dangerously broken features, and have broken back-compatibility over and over to do so. I actually hate PHP, but when I've had to use it, PHP 5.5/5.6 isn't nearly as dangerous/broken as PHP used to be (though it's still horrible).
- allendoerfer 12y agoThey have had PDO since nearly ten years now and are just now thinking about removing the worst of the other two worse DB APIs they put in the standard library. Instead of deprecating they were busy copying every language construct they could find. Even if you want to stay backwards compatible, what is so hard about deprecating it and moving the dangerous feature out of the standard library into a module after 2 years? I give them, that they are slowly changing now (probably because they can not come up with further constructs), but for a while they still deserve the rants.
- nemo 12y agoIf you said "PHP isn't aggressive enough in removing dangerous or objectively ugly language features" I'd be with you 100%. I was just pointing out that they do sometimes pull some, though I'd agree they could do better. I don't use PHP unless its a requirement and have declined nice paying job offers because PHP was involved (a 5.5/Laravel port from legacy code) so I no longer stay on top of things (don't really do Perl either anymore), but I was under the impression that they were killing a lot of deprecated legacy cruft in PHP 6/7.