Coffeehouse Thread

60 posts

Greatest PHP rant of all time

Back to Forum: Coffeehouse
  • User profile image
    wastingtime​withforums
  • User profile image
    evildictait​or
  • User profile image
    cbae

    FOSS FTW!

  • User profile image
    vesuvius

    , cbae wrote

    FOSS FTW!

    Anything not FOSS is a floccinaucinihilipilification

     

  • User profile image
    wkempf

    JavaScript is nearly as bad if you go digging around for websites full of JS WTFs. Yet, this is what the web runs on (JavaScript is used on nearly every non-trivial website and PHP is used on a ridiculously large portion of the backend for these websites). I don't know if this scares me or impresses me. Honestly, I don't.

    I've written my share of code in both JavaScript and PHP. There's nice things to be found in both, but large scale applications written in either are not worth the pain involved, IMHO. You can do some wicked cool stuff in smaller to medium sized code bases, and the really talented can manage to write some great large scale applications, but there's simply no denying that these languages don't scale.

  • User profile image
    spivonious

    "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."

     

    I lol'ed.

  • User profile image
    Bas

    This is incredible. The list of failings is good, but I particularly enjoy his parrying of the usual response to these sorts of things and why they are missing the point. Favorited.

  • User profile image
    Bass

    I think what is hilarious is these so called "bad" languages like PHP and JavaScript happen to be some of the most popular.

    And giant wall of text aside, PHP didn't really seem to slow down Facebook when it was in fierce competition with the ASP.NET wielding MySpace.

    I've witnessed this myself many times at work: My theory is that Java and C# programmers are so mired with "would the programmer elite approve of this" (eg: "am I using the right patterns?"), they don't end up actually getting much done in the end of day.

    PHP and other languages like Perl breed a more pragmatic philosophy in developers. Don't worry on how to do it, just get it done. I think the Ruby community also managed to capture this, while at the same time having a pretty well designed language.

  • User profile image
    PaoloM

    , Bass wrote

    PHP and other languages like Perl breed a more pragmatic philosophy in developers. Don't worry on how to do it, just get it done.

    Let me just call bullshit on this, ok? Smiley

  • User profile image
    Bass

    No.

  • User profile image
    fanbaby

    @Bass:lol, i was going to post something along those lines (well, that word), but you said it more eloquently.

  • User profile image
    Bass

    I find it amusing that PHP is written in a mixture of Hebrew and English terminology. It seems like English wins out a lot as the "programmers language", but I've seen plenty of German in source code as well.

  • User profile image
    PaoloM

    Why not? I mean, you stated a fact, you surely can back it up with evidence, right?

  • User profile image
    ScanIAm

    , Bass wrote

    I've witnessed this myself many times at work: My theory is that Java and C# programmers are so mired with "would the programmer elite approve of this" (eg: "am I using the right patterns?"), they don't end up actually getting much done in the end of day.

    I know you just love to beat your head on the keyboard until the sheer force of luck causes it to compile, but since I'll have to come in behind you and actually make it work, I'd appreciate it if you'd spend more time worrying about the "programmer elite" ideals of what isn't sh*tty code.

     

  • User profile image
    DeathBy​VisualStudio

    , Bass wrote

    *snip*

    I've witnessed this myself many times at work: My theory is that Java and C# programmers are so mired with "would the programmer elite approve of this" (eg: "am I using the right patterns?"), they don't end up actually getting much done in the end of day.

    I'll see your witnesses and raise you 20. Sometimes the academics types are right but most of the time they add needless complexity to a solution -- just in case. I also follow behind ball-of-mudders and understand what ScanIAm is saying but most often the guys with the stacks of pattern books at their desk write tons of code that either gets in the way or is never used. They expand the idea of separation of concerns into an excuse to "protect the programmer from themselves" by abstracting and restricting to infinity.

     

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    Bass

    @fanbaby:

    Thanks. I guess great minds think alike. Smiley

  • User profile image
    evildictait​or

    , Bass wrote

    My theory is that Java and C# programmers are so mired with "would the programmer elite approve of this" (eg: "am I using the right patterns?"), 

    As someone who has code-reviewed literally millions of lines of code in PHP, Java and C# written by hundreds of different developers, I can confidently say that's not true.

    I think the biggest difference is that in C# if you want to take data from your customer and then run it as a server side script (any security developer will now be screaming "NO!!!! - WHAT ARE YOU DOING!?") - in C# this is a hard thing to do. It's possible, but it's hard. In PHP this can be accomplished in a single line of code.

    What I'm getting at is that C#, Java and C++ say "You can do anything, but doing it right is easy, and doing it wrong is hard.". In PHP they took the tack "Doing it wrong is easy - doing it right is hard.". The programmers are just the same - they'll always try and find ways to do what they want to do as quickly as possible. It's just that Java and C# recognise that and try and encourage you to write good code. In PHP the friction is in the wrong direction. It's too easy to write bad code, and too hard to write good code. Bad programmers exist for every language, but PHP bugs are hard to spot, and more likely to be devastating than bugs in ASP.NET, which tend to stand out more.

    That's why code-reviewing a PHP website consistently takes longer, and is much more likely to contain critical security errors than those written in ASP.NET. Yes, I've found bugs in ASP.NET websites where they invoke the C# compiler to take client code and "eval" it on the server, but that pales in comparison to the times I've seen eval($val) where $var is attacker controlled.

  • User profile image
    Bass

    @DeathByVisualStudio:

    Yeah totally agree with you here. Definitely some merit in the whole OO/pattern approach, and I mean everyone talks about how great it would be if everything was written in Agile Compliant(tm) clean code with 110% unit test coverage.

    But in the end of the day when I see real solutions, you know, the things that are in production and real people rely on, they are almost always a hack job. And they work, depending on your definition of work. So I must conclude that sometimes (all the time?) the best solution doesn't win, but the easiest and cheapest that gets the job done.

    I've seen this in internal code a lot. Open source kind of exposes this to the outside world more. I've looked at glibc code that just scared the crap out of me. I guess you could chalk it to the fact that I'm not some pro C programmer, but something just doesn't seem right about 1000 line macros. But hell, it somehow just works and does its job day and in out tens of thousands of times a second on tens of millions of mission critical machines. Crazy stuff.

     

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.