I think I found a better PHP analogy


  • BINNED

    We're all familiar with the PHP hammer:

    Now, while it's a funny picture, I never really agreed with it completely. I mean, PHP, as a language, is not incompetent. It really provides facilities to do many cool things.

    On a basic level, it has things like strrev which reverses a string (to bring back a recent-ish discussion), which most languages don't. I mean, you won't need it much, sure, but if you do, well there it is!

    On a more advanced level, magic methods like __call, __get and __set can be extremely useful.

    No, I don't agree with that picture. PHP is not deficient. But it's a mess of bolted-on functions, inconsistent syntax and undefined behavior. Henceforth, I bring you an image which, IMHO, describes PHP much better than the hammer:

    http://img-9gag-ftw.9cache.com/photo/aP4MgnR_460s.jpg

    Oh yeah, That's the stuff!


  • Discourse touched me in a no-no place

    While this isn't the intention of the joke around the PHP hammer, you could still bash a nail in using the side of it.



  • @Onyx said:

    which most languages don't. I mean, you won't need it much, sure, but if you do, well there it is!

    Yes, it does it - but it's only really reversing the array of bytes (since that's how PHP internally handles strings), it doesn't handle multibyte characters, let alone combining characters or anything fancy. Trust me, you're not missing anything.

    In 12 years of PHP, I have seen strrev used twice. Once to handle endianness and once to handle retardedness because the developer didn't know about strrchr or strrpos.

    @Onyx said:

    Henceforth, I bring you an image which, IMHO, describes PHP much better than the hammer:

    It does describe PHP quite well, yes. Though I'm still not convinced it's substantially better than the PHP Hammer - you see, the PHP hammer sums up the situation in a way this doesn't.

    PHP is the epitome of the 'you had one job, one job' meme. It has one principle job - sure, you can do a lot of neat stuff and do other stuff, and sure you can do that one principle job in various ways. But it doesn't change that it has one fundamental job and doesn't exactly do it very well at all... much like the PHP hammer...


  • FoxDev

    I still prefer the hammer pic 😄



  • I prefer this one


  • BINNED

    Should've signed that 😆



  • @loopback0 said:

    While this isn't the intention of the joke around the PHP hammer, you could still bash a nail in using the side of it.

    I thought it was?

    From http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

    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.


Log in to reply