PHP Sucks

I think PHP sucks, but not for the obvious reasons. Today I got into a mild discussion on twitter, sparked by the following tweet:

It’s a nice sentiment, and worth analyzing a bit, but first… a little bit of context:

My background

I’m a PHP developer. I originally started with PHP in the early 2000’s. At that point my main exposure to programming was Pascal, and I started learning C.

Then somebody told me to take a look at PHP, and was I immediately sold on how easy it was to get a dynamic, mysql-backed website out into the world.

The code I wrote back in the day was as awful as you might expect, but I kept going, and here we are, writing PHP nearly half my life. I’m pretty good at it, and used it as the main technology for perhaps a 100 projects, some of which never leaving my computer and others that have turned into successful businesses, with millions of users and one of which resulted in an exit.

I’m active in the PHP community, as a blogger and, (ex-)member of PHP-FIG (which is PHP’s version of Pythons PEP) and have spoken at a few conferences. I’m the author of a widely deployed open-source library. PHP is one of the few things I consider myself an expert in. I think I know almost every obscure detail of the language. (Did you know echo b"foo"; is valid?).

PHP’s reputation

Whenever a discussion starts that involves PHP, on Twitter, Hackernews or Reddit or real life, it usually quickly devolves in a barrage of criticism.

Some of this is unqualified. Doing a quick search on reddit for “PHP” on /r/programming, shows that it is almost universally in a negative context.

Some of this is justified. Yes, PHP has a sloppy standard library, Yes, there is a lot of bad PHP code out there. The language itself is kind of cobbled together and things can be a bit inconsistent. Streams suck! It sucks that every HTTP request is a whole new instance of my PHP application.

Search for “PHP” and “MySQL” on Stackoverflow and you’ll see many people showing samples of code with SQL injection. There was a interesting discussion on the low quality of PHP questions on stackoverflow recently.

A big part of this issue is that the barrier to entry in PHP is so damn low, almost everyone can start hacking wordpress templates. For many people, PHP is the first programming language they try without formal education.

For me, it doesn’t actually matter that much

The big reason a lot of PHP developers get defensive when it comes to this type of criticism, is that they are personally not really affected by it.

We spend most of our time glueing API’s together, and the odd inconsistencies in the standard library are either memorized or not an issue because we use the really good auto-completion tools or we rarely touch them. Our best practices are centered around taking advantage of PHP, the way PHP is.

Our code is mostly secure, automated testing is everywhere and there’s a lot of innovation happening. Our code is closer to Java than it is to Wordpress, and the ecosystem, libraries and frameworks we use have a much greater influence on your day-to-day decisions than the underlying language.

We’ll tell you that over 50% of the web is built in PHP, Facebook uses it sucessfully and has even gone as far as making a new, faster PHP implementation. We might tell you we’re paying our bills with PHP, we’re successful with PHP, love the commmunity, love the new wave of PHP, fueled by composer and those things would all be correct.

I’m a “getting the job done” kind of person and I live by the ideas of “Worse is Better”, so PHP is a great fit for that. I would recommend many new people who have a new business idea to start prototyping with PHP, because it’s simple and pretty easy (and cheap!) to find developers for.

Why PHP sucks

Even if all those things are true, if you put PHP next to a language like Ruby, it will not win the beauty competition. If you put it next to Java, it’s a lot weirder and a lot less “correct”.

If you just look at the language, I think it fine to say “PHP is worse than Java, Ruby, Python, and many others”. If you’re just pitting the merits of the PHP language against almost any other popular language, it will likely lose. PHP is generally not approved in the enterprise, regardless of how hard Zend will try to convince you otherwise. I noticed a pattern of people running Drupal, being surprised it’s built in PHP.

So the critics are right, and so are PHP developers. Any discussion that has the slightest bit of nuance will get to that conclusion.

The problem I have with PHP has nothing to do with the language, it’s its reputation. I can’t count the times I’ve started a conversation with a programmer who upon finding out I primarily do PHP got awkward with me.

Sometimes people are more straightforward and will just respond with “Oh, I’m sorry about that”. Recently I talked to a CEO who more carefully said “Ah, that’s pretty old school right?”. Developers who more-so live in the Java-dominant corporate bubble will likely silently dismiss me as a incompetent programmer.

I hate it, because it makes me feel defensive. PHP in their minds is much worse than it practically is. I’m tired of defending PHP, I’m tired of being set back and having to proof my competence by virtue of being a PHP programmer.

We’re not taken as seriously, and we’re being paid less. The 2016 StackOverflow Survey puts PHP developers as the least paid. Hilariously that position is shared with “LAMP” and “Wordpress”, both of which are also PHP. We’re also among the “most dreaded”.

So what’s next for me?

I’m moving on to a new language. The easy thing will be to learn the language. What’s a bit harder is to learn the ins and outs of the ecosystem.

The hardest by far will be to get to a point where I can with confidence determine why library X is better than library Y, and build up a new reputation in a new community. This is frustrating, but the best time to plant a tree is 20 years ago, the second best time is today.

As for PHP. I will continue to be excited to maintain my open source libraries, but when somebody asks me in the future what I use for programming, the answer might be: “mostly Golang”.

And to anyone considering programming as a career, or trying to get into it… stay away from PHP. There’s lots of fun, interesting languages out there that also get the job done quick, but with a better reputation and this will have an actual effect on your future career options.

A few footnotes

Since this getting a lot of traction, I want to address some of the common feedback:

  1. I’m not a single language programmer, but my past has simply set me on a course that made PHP dominant. A big part of this is an open source application that took off and became pretty successful. I would say most of the stuff I’ve done in the last 5 years is related to that product. I’m very grateful for that.
  2. The reason I wouldn’t recommend anyone to get started is not because of features PHP 7 is lacking, but it is the social stigma. Want to maximize your chances at a great career? Pick something else. This is not to say that you can’t be succesful with PHP 7, it’s just that the stigma or “negative pressure” as someone called in on hackernews will have an effect.
  3. If I were just interested in paying my bills and having a job, this might not affect me as much. I have greater ambitions and want to maximize my chances in getting there. I can live with the occasional stigma, but it’s a liability.

Thanks for all the great feedback though. I got a lot of private messages from people telling me they feel the same. I regret using such a clickbaity title, but this blog post has been a long time coming; a first draft was written over a year ago and it’s nice to get it off my chest.

Web mentions

Comments

  • Rafael Morais dos Santos

    <p>Beeing a PHP for 3 years(in a professional way), I get everything you said, and thats very sad. I think many of us saw ourselves in your words. Well, I wish you good luck in your future, learning Golang xD</p>
  • Helge

    <p>I pretty much disagree with everything you wrote, which is presumably what you expect as a PHP dev ;-) How can you write "I think it fine to say “PHP is worse than Java, Ruby, Python, and many others ... it will likely lose"" and in the next sentence "So the critics are right, and so are PHP developers". No, the latter are not. The former are arguably better choices, why would you choose something that is worse? Yes, a good developer can get stuff done in any language, but choosing an arbitrary one (the one you use to know) doesn't make a good choice. There are non-non-sensical reasons why PHP (and MySQL!) is blamed the way it is, and this is really not related to n00bs (they are plenty in Java, RoR and Node too, I consider neither very good yet way better than PHP). But whatever, I applaud that you look into other stuff now, that is a really good thing. Acerbus puts it really well: "If PHP is your only skill, then you did that to yourself". If you are choosing PHP because its a great fit for the job, yes, go ahead. But I'm pretty sure your view will change once you learn how other environments work (and I'm a little surprised that you never cared before). You are so multi-lingual in real-life, it's surprising that you didn't apply that skill to programming languages ;-)</p>
    • Evert

      Evert

      <p>The problem with this perspective is that PHP is actually also quite good at solving problems. I don't really feel like making the argument why, there are plenty of resources out there that do a better job.</p><p>The point I tried to make is that if you look at the language alone in isolation, it's easy to dismiss. But clearly that's not the only factor, because otherwise we'd all be writing lisp.</p><p>This is not a rant against PHP, it's a frustration with its reputation. </p>
      • Helge

        <p>No one questions that it is "quite good at solving problems" (a plain saw is a pretty freaking awesome invention, yet a CNC machine does have some pros too). I certainly didn't read your text as a rant against PHP, in contrary, hence the "I pretty much disagree with everything you wrote". The key point for me is that you are looking into other stuff now, and that can only be good, even if you then come back and tell us that you could solve all that in PHP way easier (which I consider highly unlikely ;-) P.S.: We certainly wouldn't be writing Lisp but Smalltalk or Self.</p>
      • KeithK

        <p>A long time ago I left ColdFusion for the same reason. It was (probably still is) a good language but due to the low barrier to entry there were a lot of people writing shoddy code. These days I mostly use C# which I love and seems to have a good reputation and Python which is awesome but I fear that over time it will also suffer, again based on its low barrier to entry.</p><p>Best of luck</p>
  • markentingh

    <p>C# is the greatest language for the web &amp; for everything else. Hands down.</p>
    • hitchhiker999

      <p>As much as I hate to support MS, yes - after 35+ years of programming, I can say I've never been more impressed with any other language. Now also being able to execute code on lin/osx it has truly become an 'unpopular' favourite of mine.</p>
    • Richard Torcato

      <p>You obviously haven't learned Swift yet</p>
    • Michael Assad

      <p>I'm a big fan as well. I got into it right when it came out back in 2001 or whatever. Worked in it exclusively for about 5 years and then drifted out of programming and into sales, marketing, etc. as my business grew. Last year, when my new company required a programmer without the funds to pay one, I dusted off the old (well new) Visual Studio and started to crank. I am amazed at how easy it was to get back into it and how fast I can build stuff. C# practically programs itself!</p>
    • blaze

      <p>No thanks. I prefer Python. You can express everything in one or two lines of code and still it will be readable and good looking. A perfect choice for perfectionists!</p>
  • Ogr79

    <p>I was a PHP developer. For most of my career. I am ZCE, too. I am working in Java, now. But, I have a huge respect for PHP language, PHP developers and its community. Yes, I agreee, PHP is not a perfect language. And yes, I agree, PHP allows to write bad code. But, it is possible to write a bad code in Java, too. I saw it with my own eyes.</p><p>Very nice article. Respect for You.</p>
  • Matt Knighton

    <p>I wouldn't choose another language just for salary. PHP has some good paying jobs out their. I think full stack coders are always in demand. I love PHP because I can write a small bit of code to fix a small problem in a small amount of time.</p><p>In bigger projects we use Lint tools and other elements to help keep code under control as well as unit testing.</p><p>If you have that sort of background I think you would be in a pretty good place to earn some good dollars.</p><p>Javascript / Typescript and the like are also good things to learn so I'd be inclined to advise you go full stack. The number of PHP developers that can code good css with SASS and write Typescript and get it working over REST with a JWT auth library and launch it in a Ubuntu environment with a redis cache and opcache and actually know what is going on is very rare. Put in Nginx and some video streaming with mpeg encoders and your even more rare.</p><p>So what am I saying - just expand your tool set. PHP on it's own is not going to win you a great salary.</p>
  • kalkulatorek

    <p>I agree with you. I've been php dev for 6y. Salary for php devs is lower (in Poland) than many other programming jobs. I'm learning python now, it's fun language, prettier than php, no more {}, ; but slower. PHP it's not bad, but of course could be better. There is many annoying things in this language, == vs ===, casting, function names, errors, exceptions, @ sign. No official standards like pythons pep.</p>
  • Peter Petermann

    <p>Personally i believe that a good developer should have a variety of tools that he/she is using. <br>I don't see myself as a PHP Developer even though PHP is probably the one that I have used most in my professional career, I'm a software and game developer, PHP is just a tool that i pick for specific tasks.</p><p>To anyone considering programming as a career: never nail yourself down to one language. If you want to make a good career than remember that your craft is developing software, no writing code in a specific language.</p>
  • David Frame

    <p>Switching to another language for a higher salary is one thing, but why put so much stock in what other people think?</p><p>Try to realize that what you've experienced happens in any industry. People will always find something to look down upon when it makes them feel superior to do so. The old playground mentality of "my games console is better than yours" doesn't just stop at adolescence.</p>
  • m8

    <p>I'm going insane over here, can anyone explain why echo b"foo"; is valid php?</p>
    • Thijs

      <p>b stands for binary string</p>
    • Martin Danielsson

      <p>the b prefix casts the string to binary:<br><a href="http://php.net/manual/en/language.types.type-juggling.php" rel="nofollow noopener" title="http://php.net/manual/en/language.types.type-juggling.php">http://php.net/manual/en/la...</a></p>
  • Random Done

    <p>Personally my biggest issue is class isolation and all the ridiculous possible php.ini settings.</p><p>Use composer? Great, it's really nice! Depend on two libraries that depend on a common library in different versions? Well you're fucked since every class in a namespace can only exist once. This is a non issue in basically any other language like Java or even on Node. Going back to require or include also won't fix it.</p><p>Then the php.ini stuff, don't even get me started. You need to check for every weird setting (there's a setting that changes all non unicode string functions into unicode ones, WTF) and need tons of extensions usually that some weirdo did not enable on his setup. Python really shines here (batteries included).</p><p>You can work around all the other issues like === and inconsistent function parameters but build anything more complex and for a broader audience than a simple template and you're going to pull your hair out and flip the table in frustration. The language is just fundamentally broken beyond repair for anything serious.</p>
  • Richard Torcato

    <p>Actually the second best time to plant a tree is 19 years, 11 months and 28 days ago.</p><p>I went from Flash to <a href="http://ASP.net" rel="nofollow noopener" title="ASP.net">ASP.net</a> to Php and learned Codeigniter and Laravel. It's hard to find Laravel projects and most companies that want wordpress is because it's cheap and quick (not the best companies to work for).</p><p>I've moved over to node and express and finally found something that seems far better. So Node isn't perfect but i dont have to deal with all the php config/apache crap on the server. Now my server and client code can share the same libraries.</p><p></p>
  • relaxnow

    <p>Hey Evert! I totally agree that after having worked with PHP for a decade or so the lack of respect really does start to wear on you.<br>Then again, I think no community is immune from this. Ruby is desperately tied to Rails and certain anti-patterns. Python has it's civil 2 v.s. 3 war. Java developers are too Enterprise to get hired by startups. C# devs are tied to Microsoft, a company that can't seem to keep up with innovation.<br>You can go on and on here. A decade in any of those technologies and you'd probably feel the same way.<br>Golang is new and hot now, but in time it will get it's own 'reputation'.</p><p>That said, a new language and community sounds like an excellent way to bring back some fun! I'd be afraid I'd miss too many libraries to be competitive with other technologies but I guess you can find Golang work where that's a non-issue.<br>Personally I've always been tempted by Haskell or C#, maybe one day...</p><p>Anyway I'll miss seeing you in FIG discussions, but hope you have fun!</p><p>PS: You might want to change your sig to say "Looking for a Golang developer" ;-)</p>
    • Daniel Craig Jallits

      <p>"Golang is new and hot now, but in time it will get it's own 'reputation'."</p><p>Yes. Yes. Yes.</p><p>That said, I have shared the same feeling as @evertp:disqus for a long time. I had/have hopes that the massive advances in PHP as a language, and the ecosystem around it (ex. Composer, PHP-FIG) would shift the views to a more favorable light. The chaos within the FIG, in my opinion, killed any momentum that PHP had. I have no counter argument when this is brought up with my friends in other languages.</p><p>I have often thought about jumping ship to something different. The nice thing about a new language like Golang is that it doesn't have a reputation yet. At least there you are started at zero versus the negative view that is held by a great majority of our peers in other languages and the business community.</p>
      • Tim Hawkins

        <p>Aint going to happen, becuase all the haters are still stuck with a mental picture of php that harks back to php3 or php4. Modern PHP is a completly different animal. </p>
        • Daniel Craig Jallits

          <p>Yes, but that picture is strongly reinforced when the most popular known project uses an archaic architecture and its lowest point of entry is PHP 5.2.4+</p>
          • Tim Hawkins

            <p>Possibky, we are heading to golang too, but we are keeping php, our next generation of systems will have thin php frontend layer backed by go based microservices. Use each for its strengths. </p>
    • Evert

      Evert

      <p>All pretty great points! Thanks for the nice words </p>
  • JGrant

    <p>I'm amused that you feel like you're looked down upon by Java developers considering that in my experience they are the bottom of the barrel due to ease of outsourcing and the fact that they never have to learn to do a lot of things that Java does for them so their skills don't translate outside Java land.</p>
  • David McCan

    <p>I remember in the year 2000 my office mate and I were talking about a project where he had to use a lot of JavaScript. He held his nose, said "Eww" and laughed. Since then a lot of amazing things have happened with JavaScript. Just because the popular opinion is that the world is flat, does not mean that you will fall off the edge if you keep sailing.</p><p>Like JavaScript, PHP is also evolving. There are more good chapters to the the PHP story still being written and the fact that you can quickly craft a good solution using the language is your trump card. PHP is not just popular because it is easy to get started with, has extensive libraries and resources, or a vast community of talented programmers. One of the main reasons it is popular is that it has a relatively low resource footprint and can be easily deployed on low cost servers around the world. Mom, pop, buddy, and sis can use it, as well as Goliath enterprises like those you mention.</p><p>If you are ready for something new, then go for it, but is "others think PHP is uncool" a good reason?</p>
    • Dave

      <p>JavaScript is popular, but you can't deny that it has lots of problems. The world being flat and all ;). left-pad anyone?</p>
  • Francisco Yllera

    <p>I did that move years ago, i switched from PHP to Java, to learn how to do things "correctly" and then move on again to something better, Scala with Akka.<br>Even though C# is a nice lang its tied to MS, not an option for me, ill stick to open source.</p>
    • markrendle

      <p><a href="https://github.com/dotnet/roslyn/blob/master/License.txt" rel="nofollow noopener" title="https://github.com/dotnet/roslyn/blob/master/License.txt">https://github.com/dotnet/r...</a></p>
    • Lasse Meland

      <p>The dotnet compiler is open source, and now, a lot of the .net libraries is also open sourced, and can be run on linux and osx: <a href="https://github.com/dotnet/corefx" rel="nofollow noopener" title="https://github.com/dotnet/corefx">https://github.com/dotnet/c...</a></p>
    • Scott

      <p>Another vote here for Scala</p>
  • Grumpys view

    <p>Why do you care so much what other people think. The majority of the web is still PhP and will be for a long long time. I do a 110k a year with PhP, not bad for a script buddy ( as others would put it ). I can write in other languages but i prefer PhP for its rapid development.</p>
  • carlzulauf

    <p>The Ruby community welcomes you. It's nice here. MINSWAN</p>
  • disqus_hohlPjp95I

    <p>Reminds me on the general hate that gets directed towards jQuery. If it allows noobs to do magic, it must be bad. Right?</p>
  • Sigurt Bladt Dinesen

    <p>I want to thank you for your insights in this post, and to say hi; I'm the guy who thinks php sucks for everything it is and isn't. I'm the guy who thinks less of you as a professional, and as a person --- all because you are a php developer (if I'm ever the guy who tries to trash-talk you to the woman you love, I want you to punch me in the face).</p><p>I'm happy to read that you're a "get things done" person. It makes me think less less of you for standing by the absolute trainwreck that I perceive php to be.</p><p>Let me get this out of the way; you absolutely are a real programmer. The notion that the language, not the task, determines this is absurd. I also don't care if my doctor's prescriptions are in latin or danish (I live in Denmark), so long as I don't have to read them.</p><p>But you actively choose php every day. Which means you make poor decisions every day (again, in my percept). Am I supposed to not look down on you for that?</p><p>You admit that php falls short in comparison to other languages, that it is less "correct". When you then stand by it for letting you "get things done", I have to ask myself why these languages, that you think better, do not? Is it not incompetence standing in your way then?</p><p>I would go on about "the right tool for the right job" if you only know PHammerP, about the value of "getting it done" by using what you know, about enjoying the patterns and architectures of your work, and being appalled by the idiosyncrasies of php, about the lack of a design/labour division in software engineering that I think this debate might have spawned from, but I think this comment is long enough by now.</p><p>I sincerely meant it when I thanked you for your insights, you opened my eyes to something I had not seen. Perhaps I am naive to think I might offer the same in a comment, but here goes.</p>
    • Grumpys view

      <p>One of the most ignorant reads for a long long time. Lets compare track records!</p>
      • Sigurt Bladt Dinesen

        <p>Compare track records?<br>Okay, I'll start.<br>I have _not_ recently bumped a year-old comment, with nothing to add except dick measuring and name calling.<br>Enjoy your life rando..</p>
  • capital_P_dangit

    <p>WordPress is spelled with a capital "W" and a capital "P".</p>
  • ufmace

    <p>Honestly, I just laughed for like a minute straight when I saw that, just below your conclusion section saying that you're getting out of PHP and don't recommend it to new developers, is an ad for yourself as a PHP developer.</p>
    • Evert

      Evert

      <p>I can appreciate the irony ;)</p>
  • Gabriel Gallardo

    <p>Resources and best practices make PHP the best or one of the best ways for business, or at least is my day to day, the rest is just advertising.</p>
  • Scott

    <p>Give Scala a try, I think you might be surprised. As a mostly Java developer the past ten years I have started feeling about Java the way you feel about PHP, now that I program in Scala.</p>
  • Julius E.

    <p>Great post! I totally agree with you regarding the image of PHP as programming language. I've been laughed at for doing PHP kinda often in my company, even if the PHP backend (handling over 50 mio. users) is the main cash driver. So yeah, I kinda like the tweet from Chris.</p>
  • Lordofthenet

    <p>I think the issue is that we like to think in boxes. This technology is better than the other etc... Instead of analysing the requirements incl. time &amp; budget in order to decide which is the best technology for each project and it's goals.<br>Personally I love to code no matter which language, thus it's key to understand app design, design patterns as also the pro's and cons of the final prod. environment.<br>Depending on that I put a dev team together. Sure there is an average salary depending on market but Personally what I pay on top is based on code review as this show's me how skilled a dev is.</p>
  • dakoon2003

    <p>Somehow I don't think carpenters or mechanics really get into these types of discussions about the types of hammers or wrenches other mechanics or carpenters use.... The language is a tool, plain and simple. If a guy comes up with a tire tool to change a tire I don't look down on him because he bought it at Walmart instead of Sears... To judge somebody by the tools they use is the fastest way to kill the problem solving spirit in a young developer. PHP, Ruby, Python, GoLang, Javascript, COBOL are all just tools to be used to solve problems. To learn one at the exclusion of the others limits your ability to solve problems but it doesnt make you less of developer. I love learning a new language. I started in PHP but never turned down the opportunity to learn a different language when the situation called for it.</p>
    • Johnny

      <p>"The language is a tool, plain and simple."</p><p>The language is also a design choice, a building material, and a communications medium. I have to wonder why apologists keep trying to insist that languages matter less than they do.</p><p>If the guy had a replacement *tire* he bought for $5 at a scrapyard, would you treat it as equal to a $100 tire from Sears? You don't seem to believe that programming languages are also the building material of your software.</p><p>If this blog post had been written in Mandarin, would it have equal value to you? You claim to believe that the language is just a tool, after all.</p>
      • dakoon2003

        <p>Actually I would value it as much :) as far as the tire analogy goes if you are stranded and need a tire and he has one that holds air you would turn it down? I don't devalue the language choice but I fail to see it as a basis for judging someone. You can nail a nail with a shoeheel but a hammer does work better. Languages matter but a working product matters more.</p>
        • Evert

          Evert

          <p>I'm shutting down this discussion if there's more posts about the pros and cons of PHP. It's a tired subject and non of the points either of you will be making have not been said before.</p>
          • dakoon2003

            <p>Understood, probably easier to get everybody to agree on pizza toppings lol...</p>
  • Achin Sharma

    <p>&gt; Looking for a PHP developer for your next project? I'm looking for work! Check out my resume or drop me a line!</p><p>Oh the irony.</p>
  • Andy Skelton

    <p>Congrats and enjoy learning Golang---it's a ton of fun! You might like to change the thing that says "Looking for a PHP developer for your next project? I'm looking for work! Check out my resume or drop me a line!" at the bottom of your post. ;-)</p>
  • Sam

    <p>"Yes, there is a lot of bad PHP code out there."</p><p>I don't think that has anything to do with it. There's even more terrible C code out there, but I don't think it has a bad reputation because of this. I've waded through more than my share of terrible Ruby and Python, as well.</p><p>"Every time someone says "PHP sucks" an elephpant laughs and keeps counting their money earned from getting things done"</p><p>True. That's why I write everything in Befunge! Why should I care about the future maintainer? :-)</p>
  • Stan Bright

    <p>Hey, if you are going to move to Go, I'd suggesting checking out <a href="https://go.libhunt.com" rel="nofollow noopener" title="https://go.libhunt.com">https://go.libhunt.com</a> . It could be useful. Cheers!</p>
  • Osman Üngür

    <p>Hello evert, `o` from github. Few years ago i had same feelings like yours. Switched to Java (and Spring Boot) and i'm very happy for a long time. (I hate Scala's syntax, but if you like it, it's highly recommended)</p>
  • troyvit

    <p>Hahah clickbaity title indeed. I I saw it and thought, "Man I haven't read a 'PHP sucks' article in at least a year. About time to get my hackles up again..."</p>
  • John Haldson

    <p>It's unfortunate that you are switching away from a language because you are worried about what others think.</p><p>I use and get paid to code in more than 1 programming language, PHP being one of them. When somebody is dismissive towards me if I am discussing a project that is coded in PHP and they write it off without being able to explain why, sorry but I will write that person's opinion off on pretty much everything. I don't care about what misinformed people think who form their opinions by popularity. There's nothing I can't learn from this person that I can't learn from trolling the discussions on reddit and HN.</p><p>The people's opinions that are worth caring about aren't unguided people who bash a language because of it's reputation. This is truly something I wish I could have told my programmer self 10+ years ago. Language bashing wars - it's just noise. Don't mind these people and you'll be much better off.</p>
    • Evert

      Evert

      <p>It's not because I'm occasionally hurt by a random person's opinion. In fact, I completely empathize with why someone might have that opinion if they don't have all the facts. After all, the "PHP sucks"-mantra is repeated all the time.</p><p>My problem is that there's a general bias against PHP and I'm worried about the long-term negative effects that will have on my career.</p>
      • Will

        <p>I agree with you 100% on this. The stigma is huge and will hurt you in a lot of interviews.<br>Realisticaly though a language is only a tool and is only ever as good as the person who writes it, it's just that with PHP it is so easy to write sloppy code. Even though PHP is easy intialy I actualy think it is harder to write good code in a because it is so lenient in what it accepts. Something stricter like JAVA, Go or C# enforces you to think more about what you are passing and returning. This takes a little more time when writing the code but saves soooo much time when maintaining or extending the code.<br>Plus learning Go or Python I find faster than PHP because the language style is more consistent and has less gotchas in it.<br>Good article and enjoy Go it's clarity and productivity is hugely refreshing after working with PHP.</p>
    • Hast

      <p>You're so god damn right.</p>
  • Aigars Mahinovs

    <p>PHP is like living in a bad neighbourhood - after a while you get to know the parts of the streets that you can walk on to stay clean and the gang signs to flash to stay safe and get your work done, but you are still in a bad place with garbage on every corner and murder in the side streets. Move if you can.</p><p>Nowadays what a good software engineer or a software craftsman needs is a set of tools and materials with which he could feasibly build anything and where there are people that do build any such thing out there in the real world. For me that combination of languages has been: Python, HTML, SQL, JavaScript (JQuery and ReactJS is enough), CSS (Bootstrap is enough) and just enough Bash and Linux command line tools to get by. With that you can build anything you really want - from a website to a large scale data processing system to embedded software to desktop apps to API services to data analytics dashboards to hardware testing setups to financial transaction auditing software to that script to trigger your smart lightbulb.</p><p>Python has a TON of great libraries and nice bindings to C libraries for things where speed matters more than readability as well as an active community that takes good code quality and zen very seriously. You can write any software in Python and when you sometimes do hit an actual speed issue (and not just bad design that iterates over 100 million entries multiple times needlessly) then you can easily drop down to C for that one critical function.</p><p>The critical part is the feeling that with what you know you can tackle any software problem. That is very inspiring.</p>
  • Jakob Lorberblatt

    <p>I am a DBA working in a LAMP Stack environment for years and I personally am trained as Java Developer (and have been employed as one as well as an engineer supporting Java based web applications) but prefer python for administration automation do to the simplicity and efficiency as well as object oriented aspects of the language.<br> I do understand why to say PHP has deficits, its difficult to debug and slightly longer to write similar routines when used for sysadmin related scripts at times however it does get a LOT done, works and continues to work for decades at a time. <br> What do you think the impact of modernization will have, PHP 7 is boasting efficiency gains that no other languages revision is promising; I'm actually coming full circle to think PHP may have as much future as other languages especially based on the number of people who know the language. Do you think PHP 7 will catch on, I know php has the same reputation as Java; for developers and app stacks clinging to old versions since upgrading involves the unknown and is difficult to test thoroughly to prove the transition will be okay? If the language is efficient and uses less hardware and provides a stable platform, sloppy libraries and other oddities are more a barrier to new incoming developers then to the experienced; do you in your experience think it may be able to overcome them?</p>
    • Evert

      Evert

      <p>I think the negativity surrounding PHP has for a while not been for technical reasons. So to answer the question of if it will overcome the stigma, I don't think we have to look at performance or features but more at positive momentum in terms of people's mind space.</p><p>I find it hard to make predictions either way.</p>
  • Impurist

    <p>Props for a well written post..<br>I cut my teeth on PHP in the dotcom days of the late 90's<br>After several projects I realised PHP was not going to push my career to where I wanted to be.<br>I dabbled with Python and Java but it was not until Ruby on Rails came to my attention in 2005 that I dropped PHP all together. Rails changed the game and one of best things about it is the Ruby language. I did work end up on a large PHP Code Igniter project which was a bit of nightmare.. Thankfully partway into it they decided to change the stack to Rails. One of the main reasons sited by the Lead Developer was lack of quality PHP devs. <br>10 years and my career is awesome. I don't look for work anymore. It finds me..<br>I am now focused on JavaScript which is where I see much of the innovation going on.<br>All best with your next tech stack of choice.</p>
  • Mark

    <p>PHP was my second language (after Python) and recently (the last 12months) I have been using Go-Lang professionally in my day job. I agree with you, PHP has a really bad rep and its boring now, the same comments over and over and the thing is I LOVE programming in PHP, yes the lack of type casting really bothers me but what I can get done in PHP in a set time simply can not be matched by any other language.</p><p>I was lucky to get a job working with GO which I also really enjoy working with purely because there just aren't that many jobs for it. For any web development jobs PHP is by far the dominate language in my area along with Javascript based frontends.</p><p>It's just a shame that PHP is so easy to pick up and use that it gives it a negative press when 'have a go heros' produce really bad code. This can be said for any language, the developer is to blame not the language but unfortunately the low barrier of entry makes it a prime language for new comers</p>
  • Sheldon Hearn

    <p>You're doing the right thing. Even if you don't stop working with PHP, mastering more languages will be good for you. And I don't think you're off base; I find PHP as primary language on a resume a huge turn off and it takes something special to get me to look past it.</p>
  • toughduck

    <p>Golang is cool, and so is PHP.</p><p>We're ditching Ruby for PHP7 on a recent project, so go figure.</p><p>I'm in a hiring position, and PHP on a resume is not a turn off. Not before I've asked a couple of questions.</p><p>People are different. I just got off the phone with a seasoned banking back end dev who felt that PHP gets a lot of undeserved criticism. Earlier today I read a comment by a beginner JS guy who regurgitated some anti-PHP sound bites he didn't really understand.</p><p>The best of luck to you! :) I firmly believe learning more that one language is a very wise decision.</p>
  • Ivo Jansch

    <p>I have defended PHP for a long time. I even wrote an enterprise PHP book to defend the use of PHP in enterprise environments. But in recent years things have changed and I stopped defending it. The web is more and more API driven but with PHP's lack of multithreading or the ability to handle things asynchronously, you end up handling all API calls sequentially which means not great performance. I still use PHP a lot but it's often combined with NodeJS to make up for the asynchronicity shortcoming.</p><p>Also, I have wielded the '70% of the web uses PHP' argument. But these days I realize that probably 60% of the web simply uses Wordpress or Drupal and doesn't really care about the underlying language.</p><p>Finally, PHP in recent years seems to suffer from lack of fresh blood. Since about 2012 I see the average age of developers at PHP conferences increase (or maybe that's just me). </p>
  • Shafiq

    <p>No language is100% perfect. Php is best for all kind of website. You can do everything with php within ur client budget. Java and c# is good for entrprise application where client have big budjet. As you know facebook is developed with php. It clear that php is more <a href="http://scalable.secure" rel="nofollow noopener" title="scalable.secure">scalable.secure</a> and best for big projects. If you are a good programmer then you will write good code with any programming language .<br>Its true a programmer should learn other language like c++ c# java etc which will secure the programmer carrier.. <br>Thanks<br>Shafiq</p>
  • Edwin

    <p>Great post. I took PHP off from my portfolio years ago for that same reason: the stigma for being a PHP developer. I confess that I still use it on the downlow when I want to give away freebies to friends and family.</p>
  • ArtStoneUS

    <p>In programming jobs, pay is inverse to the simplicity of the tool. If anyone can use it, you get minimum wage. If the tool requires 6 months of vendor certification before you can write Hello World\n, you make big bucks.</p>
    • Evert

      Evert

      <p>You can really make grand statements like that without backing it up with stats. It's much more likely that supply and demand is the major factor here.</p>
  • Brade

    <p>Interesting post! But I can say that PHP has paid off handsomely for me, and I'm currently senior dev at a heath-care industry startup where I've primarily built our apps in the PHP framework Phalcon. I have a degree in CS and have experience in a wide array of languages, but I'm a pragmatist first and foremost so PHP fits my personality perfectly. Also I tend to be a devil's advocate, so when I sense snobbery towards something like PHP, it makes me want to defend it all the more. If you want to switch languages, that's fine. But we only have one life, so we might as well take a few risks and do what we enjoy. That's my POV anyway.</p>
  • Dmitri Ponomarjov

    <p>PHP is not less-payed compared to other languages. It has less average wages. What's the difference? The difference is in low "barrier to entry" you've written about. Just because we have a wider range of developers skills doesn't mean that top-qualified Java developer gets better salary than top-qualified PHP developer.<br>A social stigma? Sorry, but I'm laughing over it. New hype-languages come and go, empires rise and fall, and yet there still is a PHP, better than ever. We are the ones who look at new raw hype-named technologies sceptically now, not the otherwise. World has changed, take a look at it :) I haven't heard any criticism for PHP from potential clients in years. They don't want any risky experiments, they want to have things done.</p><p>Anyway, thanks for an opinion. I think that you are just generally tired from using one and the same language for 16 years, which is pretty much.</p>
  • Dima Taras

    <p>php is not bad. But I agree that I need to learn and practice some new language.</p>
  • Сергей Лунев

    <p>PHP sucks? <br>As language design, may be, but don't think so as for PHP7.<br>As ecosystem? May be. But with tools such as composer, phpunit and other, don't think so also.</p><p>My experience tells me that people from other languages that shits on other languages don't have enough level of programming.</p>
  • Appels+Oranjes

    <p>I felt the same with that Javascript horror for apps, I switched to Swift, I'm really happy now</p>
  • Vision Websoft

    <p>So...what new language did you decide to learn? Golang by chance? Highly recommend that one...https://<a href="http://golang.org/" rel="nofollow noopener" title="golang.org/">golang.org/</a></p>