4 ms·
Reminds me of "PHP Hammer" I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in
by codeulike 6y ago
Reminds me of "PHP Hammer"
I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP.
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
edit: Flickr user @raindrift made an actual PHP hammer, famously https://www.flickr.com/photos/nicoletbn/6949293600 https://www.flickr.com/photos/nicoletbn/6949293600
2012 discussion of hammer https://news.ycombinator.com/item?id=3866488 https://news.ycombinator.com/item?id=3866488
TechCrunch defence of the hammer https://techcrunch.com/2012/07/28/not-that-kind-of-filthy-get-your-mind-out-of-the-gutter/ https://techcrunch.com/2012/07/28/not-that-kind-of-filthy-ge...
- hnarn 6y agoThat's funny and all, but it doesn't drive home much more of a point than "PHP is bad because PHP is bad". The insinuation that all "houses" built with PHP are defective and waiting to fall apart is so obviously untrue that it feels unworthy of discussion. A more reasonable analogy would be that there's a standardized toolbox that carpenters use that's weird, quirky and sometimes so bad that you need to know workarounds to use it correctly, but the houses that are being built do what they're supposed to in the vast majority of cases because most of the carpenters know the quirks well. The question then is, if you're contracting someone to build your house, or you're the manager of a construction company, do you go with the standard toolbox that's used by the X% majority of carpenters, or do you hire carpenters that use more obscure (but functionally "better") toolboxes while running the risk of now ending up with unmaintainable or deviating houses that are hard to recruit additional carpenters for because they refuse to work on what is quite objectively "non-standard" houses? The answer in my mind is no less complex than it would be for software development: it depends, and you should be wary of anyone telling you that it's "obvious" that the answer is one or the other.
- codeulike 6y agoFair point about the houses
- xd 6y agoAs yes, the 2012 fractal of bad design, being peddled out yet again - your post is just pure hate, it adds no valid argument whatsoever.
- wccrawford 6y agoI think a better analogy would be that the PHP carpenters have standard old tools that people have used forever, and they work just fine. Normal hammer with wooden handles, normal planes, etc etc. But there are modern carpenters that have hammers that are 100% metal and never break and actually improve your hammering power. The new electric hand planes work a lot faster, though you do have to be more careful because they can get out of hand quicker. etc etc. In the end, they both build houses. The old-school carpenters might take longer, and they might have to know more techniques, but they get there in the end. On the other hand, the modern carpenters sometimes go a littler overboard with their tools and have problems that old-school carpenters don't have, especially with their tools randomly stopping working in the middle of a job. It might not be often, but it happens. To add to that, the old-school carpenters can actually use a lot of the new tools, too. They fit into the workflow and can be adapted to their old tools. It's just that they primarily stick with their old tools because they're used to them. It's kind of interesting how much the world of woodworking and software development overlaps in that way.
- codeulike 6y agoThe difference comes in how often modifications need to be made
- ptx 6y agoYour analogy makes is sound as if the problem with PHP is that it's old or lacking features, whereas the point of the original analogy is that it's poorly designed. (Python is older than PHP, so it's not a question of being modern or not.)
- wccrawford 6y agoBy today's standards, old tools are poorly designed. At least, most of them. The one's that have stood the test of time aren't the bad ones. Those old tools still worked, just not as well as modern versions.
- ptx 6y ago
- Frondo 6y agoI don't want to get into an "all languages are the same / all languages have quirks" kind of thing, but the idea that PHP is weird, different, and in a sense inscrutable, and this has an impact on its use and performance, just doesn't bear out. Yes, it has quirks -- so does C, so does C#, so does JS, so does lua, so does tcl, so does every assembly language I've ever worked with. So what? Are those preventing people from writing good code? Are those preventing people from shipping? Could it be improved? Has it already been improved? No, no, yes, and yes. The biggest reason PHP's gotten so much scrutiny, to where people write these kinds of posts, is its ubiquity. When JS moved from being that simple, silly language built into the browser into a widely used one, we started seeing slide deck gags about the inscrutability of its comparison operators, yet JS seldom attracts this level of derision.