3 ms·
> PHP is considered a beginner-grade toy, despite the comparatively vast expertise one needs to write correct code in it. As someone who's built a career on (m
by Domenic_S 11y ago
> PHP is considered a beginner-grade toy, despite the comparatively vast expertise one needs to write correct code in it.
As someone who's built a career on (mostly) writing PHP, this this this. It is indeed incredibly easy to write "working", terrible, insecure PHP. Honestly, people who write garbage PHP would write garbage rails/python/node too, because the errors fall into a few buckets:
1. Not using a framework's API/reimplementing boilerplate poorly.
2. Not paying attention to user-generated input (escaping, etc).
3. Not using best practices for major tasks (e.g., manually mysql_connect()'ing instead of using PDO)
4. Failures in logic ("brain farts").
These problems are the same in any language. If you CBA to pay attention to the basics in PHP, you won't do it in rails either. Blame the programmer, not the language.
The counterargument is that some languages won't let you make these mistakes, but the counter-counter is that those people would make those mistakes if they could, which is not really an improvement IMO.
- overgard 11y agoI think the real counter argument would be: why would you use a language where it's easy to screw up in subtle ways as opposed to a language that makes it much harder to screw up, if all else is roughly equal. PHP is a minefield in ways most other languages aren't. Part of writing fewer bugs is setting yourself up with tools and practices that make writing bugs harder.