1. 22
  1.  

  2. 29

    So, there’s a few different things going on here that are worth addressing, not all of which are “zomg PHP is teh suck”.

    The basic problems with “ew, you use PHP?” can be restated as the true questions that statement is a proxy for:

    1. “Ew, you use old languages that willfully are just not very well designed?”
    2. “Ew, you use dynamic languages with a history of shitty tooling and no <insert favorite PL wonk accomodation here>?”
    3. “Ew, you have a well-established project that I’ll be doing menial maintenance and fiddling with?”
    4. “Ew, you won’t be teaching me anything that will be applicable outside of the language-infrastructure-ops environment I learn here?”
    5. “Ew, you won’t be giving me a chance to learn a new technology?”

    Let’s ignore the first question because a) it’s well-established that with PLT as a metric PHP sucks and b) that suckage has absolutely nothing to do with its (or other similarly bad languages like Javascript or C) successfullness in the world.

    The second question we can similarly dismiss other than to observe that while projects like HipHop, Laravel, and Composer are bringing modern development tools (static analysis, convention-over-configuration, and dependency management respectively) to PHP development, whether or not any particular legacy codebase or quick-turnover project actually uses them is still a huge crapshoot–so much left to chance that it just isn’t interesting to talk about.

    The last three are the real questions we should be wondering about.

    Most normal developers at some point or another will have to work on an established codebase or project. They will not get to do the fun greenfield work, but instead will be stuck dividing their time between:

    • building a mental model of the existing system
    • trying to figure out why the existing system exhibits an undersired behavior (bugs)
    • trying to figure out how to as painlessly as possible graft unforseen functionality onto the existing system (feature)
    • wondering why the fuck they aren’t getting paid more for doing the above

    Assuming the PHP codebase is old and established–especially knowing what industry standards were years ago–it’s reasonable for a prospective dev to realize that each of the above tasks will likely be more difficult than is reasonable. An experienced developer will also recognize that any business saying “We need to migrate to a new stack!” is setting an elaborate track, as the majority of those efforts fail and just result in new badly-understood systems that don’t do everything the old ones did.

    The problem of a PHP gig leading to hyper-specialized knowledge that is nontransferrable is also quite real. Mailchimp has a bunch of cool things they’ve done to scale, but how much of that will the average dev be exposed to? Further, how many companies will follow a business trajectory that makes those lessons preferable to simply using something reasonably modern?

    A new dev educated in a mature engineering ecosystem is quite likely to:

    • become too dependent on process in a different environment successfully (NASA engineers being a poignant example of this, having gotten used to massive bureaucracy)
    • become too dependent on tools to be able to function “without a safety net” or solve problems in their own vocabulary (People used to test suites in opinionated frameworks like Rails saving their ass being unable to write small Sinatra or Node apps correctly the first time and avoid abstractions that are too complicated to manage by themselves)
    • become too dependent on mature administration setups to be able to meaningfully handle their own ops (Folks used to helpful shell scripts that automagically spin up and deploy instances and troubleshoot problems being unable to standup their own server for a project)

    This is hardly a problem limited to PHP shops, incidentally, but the defense of “We don’t write the bad PHP, because we have a system in place to solve all the hideous problems we’ve had with it!” does not address it.

    The last part, about learning a “new” technology, is reasonable. PHP is not new. PHP is not going to teach anybody much about modern programming ideas or engineering culture. If a dev wants to grow as a general-use developer, PHP won’t be better than any of the other languages in use today and may actually be worse than some of them.

    EDIT: Quick addition because I forgot it while submitting.

    So, please, don’t let’s waste time treating this as a chance to badmouth PHP-the-language, but instead try and figure out the other problems and issues facing a prospective hire that that question alludes to.

    1. 2

      Thanks, I got carried away.

    2. 12

      I don’t use MailChimp that much but I think it’s quite nice that you never hear anything about downtime from them, like one does about hipper startups not using PHP. I don’t ever want to touch PHP again but it seems like they take it seriously and do good work with it.

      1. 2

        At my previous job we moved from a home-brew newsletter system (which was extremely misguided and ended up failing once I started configuring more secure mail configuration [like a simple SPF record]), and found that it is actually a great system. My favourite aspect of it is the multiple email client inbox testing for when you are building an email HTML template. If you have never had to build one, feel gracious because they are tedious, outdated, and just painful to construct.

        The constant uptime is great too.

      2. 5

        This article is from 2010. I think in 2010 the backlash against PHP was in full force as everybody was riding the Rails wave. I think the “Ewww PHP” attitude was stupid then, but it’s even more stupid in 2016 where we have some perspective on what Rails (or Ruby in general) is best at vs. what PHP is best at vs. what Node is best at, and the fact that ultimately it’s down to developer preference to select the right tool for them for a given job.

        We use PHP on my team because the applications we work with were written in PHP. If someone says “eww PHP” I wouldn’t even consider hiring them. It shows a serious lack of maturity.

        1. 20

          “Hey, sewer rat may taste like pumpkin pie, but I’d never know ‘cause I wouldn’t eat the filthy motherfucker”

          And PHP might be the greatest thing since sliced bread for solving your business problem, but I’ll never know because I refuse to subject myself to using such a bad API and toolset day in and day out.

          1. 5

            Yeah this is exactly the crappy attitude that I was talking about.

            PHP has its problems but JavaScript, Ruby, Python, etc. all have problems too. Nothing is perfect.

            Being so closed minded about PHP or anything else just makes you into a worse developer than you could be otherwise for no good reason.

            1. 15

              PHP has its problems but JavaScript, Ruby, Python, etc. all have problems too. Nothing is perfect.

              This isn’t a binary though, it’s a matter of degree. Maybe PHP is better now, but historically PHP was a complete mess. So saying “nothing is perfect” is a useless statement. Nothing being perfect doesn’t mean everything is equal.

              Being so closed minded about PHP or anything else just makes you into a worse developer than you could be otherwise for no good reason.

              Why? Is there a particular conceptual framework PHP has that other languages don’t? Is there something about PHP I cannot learn in a week if I already know other imperative languages? What exactly is one missing out on by having no interest in learning PHP?

              1. 9

                Well you’re missing out on learning Hebrew, and a window into the psychology of Rasmus Lerdorf. All kidding aside there was a day and age when PHP made sense for web development, and that time has come and gone. Anyone using it today is wasting money and time.

                1. 1

                  Is there something about PHP I cannot learn in a week if I already know other imperative languages?

                  Thinking you can master any language in a week shows a lot of hubris and/or ignorance.

                  Every language has things to offer. I don’t know what your current skillset is so I can’t tell you what you’d learn by working with PHP, or working with various applications or frameworks in PHP.

                  The reality is a lot of the web is in PHP, so by choosing to remain completely ignorant of it you’re choosing to be ignorant about a large portion of the web.

                  I’m not personally a fan of WordPress but it is the dominant web application at the moment, and it’s written in PHP. It’s only the most obvious example of how you’re keeping yourself (and nobody else) in the dark by choosing to stay ignorant.

                  I’m not here to convince you to pick up PHP specifically. If having this affectation of “I’m above PHP” is really important to you, then great. I am glad I will never have tow work with you.

                  1. 12

                    Whoa, who said anything about “mastering” PHP? One isn’t going to master it off some casual inspection of it either. My point is that the basic tenets of PHP are pretty much the same across any imperative language, so there isn’t some fundamentally interesting aspect of PHP other than it’s own idiosyncrasies that make it worth learning. Similarly, the differences between Python and Ruby is not so severe that learning one “just cause” will impact one’s life considerably.

                    1. 10

                      The reality is a lot of the web is in PHP, so by choosing to remain completely ignorant of it you’re choosing to be ignorant about a large portion of the web.

                      This mans absolutely nothing. The web does not require PHP in any way, it is perfectly possible using and developing for the Web without any knowledge of PHP. It’s not like it’s some sort of fundamental technology like HTTP. It’s not even close to JS because client-side coding requires JavaScript in some way even if just as a compiler target but there is just nothing that would require you to know about PHP.

                      Also, WordPress ist just an application and there are plenty of alternatives for getting the issue at hand done without requiring WordPress.

                      1. 5

                        Every language has things to offer.

                        Again, it’s not a binary. Some languages have a lot to offer; some have very little, and given limited time it makes sense to prioritize the better ones.

                        I’m not personally a fan of WordPress but it is the dominant web application at the moment, and it’s written in PHP.

                        It is; it’s also awful. It has a terrible security track record and an awful comment system (you have two tickboxes to configure what kind of reply notifications you want. No possible combination of those tickboxes will give you the obvious correct configuration that you actually want, that sensible comment systems (e.g. disqus) give you by default). There are much better alternatives available in other languages, so if WordPress is the best argument for PHP then I’m happy to stay away from it.

                    2. 8

                      The difference between javascript and PHP, is if you’re writing for the web you literally cannot avoid javascript, you however can avoid PHP. I have learned and used PHP, It’s only good to learn because it shows you what terrible decisions can be made in language design. PHP was designed for personal homepages and for that problem it’s passable, but for any professional project you’d be burning money to choose PHP. There’s just no reason to work that hard, and that slowly. Secondly because the number of PHP programmers are dwindling you’ll be paying an arm and a leg to hire any new talent.

                      1. 0

                        It depends what you’re doing on the web. If you’re a freelance developer making websites for SMB good luck avoiding PHP. WordPress is the dominant force out there.

                        You claim to know PHP but then you say that “It’s only good for personal home pages.” Why is that? How does that claim make any sense? I would actually argue the exact opposite. The only way to write good PHP code is to actually use the OOP aspects of it. PHP has tools to write solid, unit tested classes especially in 7.

                        Also, you can totally avoid JavaScript if you really want to. It’s probably stupid to do so, but you don’t have to, for example, write a single page application using JS. But I would think any developer worth her salt would do try her hand at writing a single page web application at some point using JS (either vanilla or with a framework.)

                        Anyway this conversation is getting dull. I’m clearly not going to convince any of the willfully ignorant people in this thread so I’m gonna stop replying now. Good luck, I hope you grow out of your current mindset.

                        1. 8

                          I’ll try and leave behind some of the salt. I am fairly certain that you are capable of writing a good large project in PHP, but I am equally certain that you could do much better with nearly any other language. While PHP does not scale well, is prone to errors in ways that no other language with type safety struggles with, and is slow with no benefit to usability. I concede that if you’re going to any project which is already written in PHP, you have no choice. I also concede for personal projects, it really doesn’t matter and if you enjoy PHP by all means keep using it. I am not trying to make you upset, but I am trying to prevent people from falling into the trap of thinking PHP is as good as it gets. Or the maintenance trap that they should start any larger project in PHP. Would I work at any place that used any PHP? maybe.

                          Would I work at a place that mainly uses PHP? absolutely not.

                  2. 18

                    If someone says “eww PHP” I wouldn’t even consider hiring them. It shows a serious lack of maturity.

                    If someone said “eww X” during an interview, that would be a serious red flag for me, which doesn’t have anything to do with PHP, it’s just not a very grown up reaction. I think if a candidate said that they really were having trouble getting past the PHP thing, I would take that seriously and try to convince them (if they were otherwise good). Or maybe look at making a non PHP initiative within the organization of growth was important.

                    1. 1

                      This obsession with seeming grown up seems bizarre and foolish to me. Older workers and older companies seem to place a huge amount of value on it (even at the expense of actual productivity) and I just don’t get why. Does it make you happier?

                      1. 2

                        Let me provide some context incase it’s unclear what I meant. And by “obsession” I’m not sure if you are characterizing my response as such or a general observation. But in the situation of a job interview, one of the dimensions I look for is a candidate acting in a respectful way relative to the situation. An interview is fairly formal and as such I expect thoughtful answers. I think saying “Ewww X” (unless somehow the context allows it) would be a red flag. The candidate, if hired, might be sensitive situations with a customer or talking to the CEO, etc, where it’s needed to act in a particular way. So that doesn’t mean if I work with someone I don’t expect some childish behaviour.

                        1. 1

                          Come on, nobody just goes “EWW GROSS” at an interview. I’ve had the “Eww” reaction in an interview, but it sounded more like “Well, it ain’t my favorite tool, for a variety of reasons that I’d be happy to explain in another context; if that’s the tool you’re using, then I’ll use it too.”

                          1. 5

                            Come on, nobody just goes “EWW GROSS” at an interview

                            You’d be surprised.

                    2. 6

                      I don’t think you’d have to worry about hiring them, because they wouldn’t want to be hired if they didn’t like php.

                      1. 2

                        Yeah, I’ve developed in PHP before, but prefer several other languages over it. If I had some job offers and one of the companies used PHP while another used Python, all other things being equal, I’d take the job working in Python.

                      2. 9

                        I wouldn’t hire anyone who would not say ewww to PHP. Seriously, you could literally roll your own language that would be better than PHP in less than 6 months. Learning how to use Haskell so that you have a decent tooling to do so included.

                        1. 19

                          Seriously, you could literally roll your own language that would be better than PHP in less than 6 months.

                          That is the attitude that creates the next PHP.

                          1. 10

                            I disagree. That is that attitude where computer programmers learn to write compilers. Most people who try it usually end up being better programmers that no longer want to roll their own compiler. Unlike the PHP guys who refuse to either stop or learn how to do it better.

                          2. 15

                            I wouldn’t hire anyone who would not say ewww to PHP.

                            If you aren’t joking, that’s a really unfortunate attitude to have. I personally don’t have any love for PHP, but I’d never discriminate a hire because they didn’t fall into line with my personal feelings on technology choice. I’ve built products in PHP before, and while the language and stdlib leaves a lot to be desired I didn’t hate it either. These days I work on large-scale graph processing systems for $dayjob and sling Rust/Haskell in my free time. But, by your criteria, I’d never have been hired.

                            Seriously, you could literally roll your own language that would be better than PHP in less than 6 months.

                            PHP is the product of many man-years of efforts. It’s not even a diamond in the rough, but it’s crazy to think you could create a language with as much utility, stability, and performance as PHP in 6 months.

                            If there’s actually one thing I miss about PHP it’s keeping an editor open in one window, making a change, and refreshing the page to see the change. That feedback loop was unbeatable. Even now, my Java/Scala services usually take a restart to show a change (hot-reload has huge limits).

                            1. 1

                              Try Clojurescript with Figwheel - you don’t reload the page at all, just write your changes and they’re automatically loaded in the browser.

                              1. 1

                                It’s not a bad idea. I know Clojure has this tooling working considerably better than the rest of the JVM ecosystem at present.

                            2. 0

                              you could literally roll your own language that would be better than PHP in less than 6 months.

                              This shows you are totally clueless. PHP has problems and a lot of bad design decisions but there’s just no way you could make something better from scratch in 6 months. That’s just delusional.

                              If you tried to rush and make a full language in that amount of time you’d probably make as many or worse mistakes than the PHP developers did.

                              1. 9

                                Just how long do you think it takes to write an llvm backed lisp or ml?

                                1. 4

                                  PHP is not just a simple parser, it’s also a collection of a ton of libraries.

                                  1. 6

                                    Then make something that does interop with Java, JavaScript or Ruby to have access to a ton of libraries.

                                    1. 5

                                      Just llvm alone buys you all the C interop you might desire; e.g., http://www.stephendiehl.com/llvm/#external-functions

                                      I wager that a great majority of devs reading lobsters could create their own lisp or ML within 5-6 weeks of dedicated effort, and then spend 3 months finding and linking up libcurl, libmysql, etc., if libc wasn’t deemed good enough.

                                      The big problem with the 6 month language would be that nobody else would be using it, so you wouldn’t have stack overflow. That’s the big benefit of php and node.js: the hundreds of millions of developer solutions you can copy-paste into your code and have at least a 45% chance it’ll work.

                                      1. 2

                                        Just llvm alone buys you all the C interop you might desire; e.g.,

                                        ABI is not interoperability, and parsing headers, hooking into GC, understanding and making sense of headers, macros, and so on is not trivial.

                                    2. 3

                                      Yeah, honestly I’ve always thought that’s the selling point of the language. It binds against a couple hundred important C libraries and links them in by default, which means there’s no need for most PHP developers to worry about installing dependencies.

                                      I wish that didn’t outweigh language-design praxis, but it’s a real advantage. :/

                                      1. 1

                                        But libraries aren’t part of the core language. The argument isn’t about building the ecosystem and having the same tooling, it’s about the core language.

                                        1. 1

                                          When one is arguing that people should stop using it, all these factors are relevant, however unfair it might feel.

                                    3. 5

                                      Interpreted, dynamically typed language without a JIT compiler, with MPS as the GC and GMP for large numbers would take about 3 months. I would basically copy scheme semantics (first class functions, lexical scoping, left-to-right evaluation) and throw in Racket-like generics instead of OOP. Module system would roughly copy Python semantics.

                                      Rest is stdlib, FastCGI, an alternative parser for jinja2-inspired templates and integration with database client libraries.

                                      I am not saying that making it stack-less via CPS conversion, adding fast tail-call optimization, JIT backend, and a better GC would not make it over-multiple-years effort, but those are not features PHP fancies.

                                      I am also not saying that I would recommend doing that. Why should I? I’d be basically re-writing something between Scheme, Python and Ruby with zero community support. I am just saying that PHP is an extremely primitive tool also done wrong and anyone not seeing that / not trying to use something better would be a bad hire for anything else than maintenance of an old PHP application we can’t just kill yet.

                                      Also, after writing in anything at least a bit more advanced language and then returning to PHP where you feel like both your hands are cut off should leave at least some ewww. But as with most things, this is just my weird opinion.