3 ms·
PHP: A fractal of bad design (2012)
- gjsman-1000 3y agoThis article is so obsolete it’s actively painful every time it’s brought up.
- jimberlage 3y agoI’m genuinely curious about PHP because lots of people seem to really like it! Is it like C++, in the sense that there are still a lot of footguns but people who invest the time to know where they are grow to like the language? Or have they actively removed the bad APIs in recent versions?
- NateEag 3y agoPHP made it incredibly easy to build and deploy dynamic websites in an era when those things were not straightforward or widely understood. The fact that it's a pretty poor language under the hood was irrelevant, because almost anyone could pick it up and intuit how its (crummy) built-in templating worked well enough to get the job done. Its popularity was largely rooted in how easy it made it to Get Shit Done. Sure, there were near-apocalypse level footguns everywhere in the first four major versions, but those didn't get noticed until the project had been mostly-working in prod for months. It got first mover advantage due to that, and that sort of lead dies off very, very slowly. These days PHP has mostly evolved into Java-lite, with some pretty decent frameworks and tools to keep you far from the footguns lying all around due to backwards compatibility, and CLI tooling to pre-emptively warn you when you've stepped on one (not unlike ESLint or TypeScript, really, which are both projects to make using JS less dangerous).
- jimberlage 3y agoAh, so the footguns are still there? Nothing against it (I’m sure a seasoned PHP dev knows to avoid them) but I might pass. I’d be too unsure of myself for a while while I get comfortable with the language.
- NateEag 3y agoSome are gone, some are not. In most cases the style checkers and linters will warn you about them pre-emptively. At least, that was the state of things last I looked. I haven't touched PHP in probably two years now. Of all the languages I've worked in, it's my least favorite. Well, it's neck and neck with Java.
- matheusmoreira 3y agoI remember someone here on HN said most if not all of the problems in this post have since been fixed. Is that actually true?
- db48x 3y agoA few things are better, but the core design decisions were all bad, and they can't really be changed over time. No matter how many surface problems they clean up, you will always be better off using any other language.
- gjsman-1000 3y agoAbsolutely false and a misinformed statement. Every language has design mistakes (like what does “this” mean in JavaScript?). The only question is - how bad is it? PHP’s pretty average now, but gets more Java-like every release. I could make a very long list of quirks in JavaScript you’ve learned to ignore. Performance is also no longer a significant issue. Facebook, PornHub, Wikipedia, Etsy, Slack, and more are still happily ticking on PHP codebases.
- kyriakos 3y agoThese conversations have become so predictable it's funny. Someone will now bring up that Facebook wrote its own language called hack. Someone else will mention laravel. Another one will say he stepped using php xx years ago and never looked back so the language is still bad for him etc
- db48x 3y agoI admit that my most recent experience with PHP was from two whole years ago. If they’ve made any improvements since then they didn’t tell me. Still, I stand by my statement that anyone would be better off with almost any other language.
- xigoi 3y ago> gets more Java-like every release …and you consider that a good thing???
- kyriakos 3y agoNot this again. 12 years later PHP evolved and is still being used.
- _zagj 3y agoSigh I was going to write a defense of PHP, but since it's flagged, I won't bother.
- CR007 3y agoZzzzz tired about this heavily outdated article. Let it RIP for good sake, POS that the author never updated what a joke.