4 ms·
I know it's cool to hate PHP but I can think of other languages (Perl, VB6, Groovy) I dislike more. For a language to be so hated it has to be used a lot, and t
by mikece 6y ago
I know it's cool to hate PHP but I can think of other languages (Perl, VB6, Groovy) I dislike more. For a language to be so hated it has to be used a lot, and that's the primary virtue of PHP: it runs damn-near everywhere. Not only web scripting/apps but you can use it for shell scripting, Lambda/Azure Functions... there are even frameworks for creating native mobile applications with PHP. And I wouldn't be surprised if it compiles to JavaScript as well.
- bch 6y ago> For a language to be so hated it has to be used a lot, and that's the primary virtue of PHP: it runs damn-near everywhere. “Runs damn-near everywhere” is true of nearly all contemporary scripting languages, though, no? It’s definitely used a lot, though I don’t know how that compares to Perl, Ruby, Python... Without digging in harder, I still think it came at about the right time and had a killer feature: a dynamic nascent web with an incredibly low barrier to entry. You could create a form and ask for a persons name and have it respond “Hello, $name!”. I feel like it got entrenched and never gave that up.
- jakevoytko 6y agoYeah, I think that goes back to something the OP said, which is that it's a victim of its own success. It's old enough that everyone has had a bad experience with it. I've had many that are directly or indirectly tied to PHP - my college blog was a hodgepodge of unmaintainable PHP scripts, I've run Wordpress blogs with plugins that broke in horrible and confusing ways, some things like argument order and operator precedence are confusing. Combine with a long-enough life to have some famous bugs (like the hash collision DOS attack), and you have a recipe for widespread derision. But it kept getting better. I work in PHP at my day job, and I enjoy it. Tools like PhpStorm and Phan make the experience excellent. If PHP 7.4 were launched today as "AWSLang", a stateless object-oriented optionally-typed scripting language that seems designed for working with Lambda functions, we'd love it. "You mean it just dies at the end of the request by default? No shared mutable state between requests? How functional!" Sure, we'd have a few things to complain about. But don't we always?