Why developers hate PHP
PHP is the most widely used language in the world for websites. It is also the most hated. And it’s pure hate. But why do so many developers hate it so much? Today we’re going to the origin of the hate, let’s see if it’s really justified.
Don’t touch my PHP
If I’m saying that PHP is hated by the whole world, it’s not my personal opinion. In the latest stack overflow survey, developers from all over the world put PHP in the top 5 most dreaded languages. The latest Hired survey puts it squarely in the top 2 most hated. There’s a lot more and I’m not even talking about what’s going on Reddit. If you’re a PHP developer since 20 years who came here on a crusade to crucify me on the altar of Symfony, please relax. We’re here to talk, put the gun down. Well now on the contrary if you hate PHP with passion : take some pop-corns and sit down comfortably.
Once upon a time I was doing some Symfony2 myself. And I liked the whole Symfony thing, frankly, it’s not bad. I told this to a developer I met at a devops meetup. He was shocked, he was about to vomit, he looked at me like I just murdered a newborn baby. From now on I’m going to call him James to make it easier. So I immediately asked James a question: why so much hatred?
PHP trouble past
To understand what’s coming next, you need context. In order to do that, let’s make a little rewind. It’s 1994 and Rasmus Lerdorf is quickly coding a C tool suite. This suite of tools is used to manage his personal website. Rasmus is doing it just for his own need at the time. He doesn’t want to turn it into a programming language. Nothing in this tool suite is designed to become one. A year later Rasmus released this open source toolkit called then: PHP/FI. And it looked like this.
<!--include /text/header.html--> <!--getenv HTTP_USER_AGENT--> <!--ifsubstr $exec_result Mozilla--> Hey, you are using Netscape!<p> <!--endif--> <!--sql database select * from table where user='$username'--> <!--ifless $numentries 1--> Sorry, that record does not exist<p> <!--endif exit--> Welcome <!--$user-->!<p> You have <!--$index:0--> credits left in your account.<p> <!--include /text/footer.html-->
We’re far from what you’re using today in your huge PHP7 framework, aren’t we? Yet it all comes from there. For the rest of the story : the code is taken over by a dev team and PHP/FI2 is released in 1997. In 1998 a part is rewritten and PHP3 is released. In 1999 the core of PHP is totally rewritten to produce Zend. PHP4 follows the next year and PHP5 is released in 2004 with Zend2. PHP6 got canceled because the development has turned into hell on earth. Finally, through yet another major rewrite of the language: PHP7 is released in 2015. I remember at the time I was very excited. But originally, Rasmus was just coding his own thing . In 2003 he did an interview and told some incredible things.
“I really don’t like programming. I built this tool to program less so that I could simply reuse code … I don’t know how to stop it, there was never any intention to write a programming language […]. I don’t know how to write a programming language at all, I just kept adding the next logical step.”
Inconsistency and poor design
Back in 2019 with our friend James from the meetup. He immediately started talking to me about the “disgusting” syntax of PHP. How the language is not typed. How the language is mostly unpredictable. Whether it’s on the use of operators or the incredible inconsistencies in function naming. I’ll spare you the list of technical problems because otherwise this article will take you all day to read.
If you really want to know everything I found you the most pissed off person in the world against PHP. No, actually I think the person who hates PHP the most is actually him. All those posts validate what James was telling me. Developers hate PHP because it’s a technically inconsistent language with a bad design. When you compare it to other languages the contrast is obvious. If after reading these two articles you can’t admit that PHP have some problems it’s because it became your religion. And I stopped trying to convince fanatics.
Using PHP it’s very easy to produce bad code. Other languages have many more restrictions. We also see a lot of security problems with PHP. And the problem is the same here. It’s very easy to make bad and insecure code with PHP. But PHP is not a security hole or doomed to ugly code if you code properly. Developers hate PHP because you are more likely to get errors with a language that allows so much freedom.
Victim of its success
There is another important factor in this ambient hatred. Developers hate PHP because it is used everywhere. This blog runs on PHP7. Like most of the web I just need to host a dynamic page which is then cached. PHP does the job. Yes the language itself is not the best. Yes i could use a super duper stack. But who cares ? It meets my needs in a fast and accessible way. It’s also for this reason that 80% of the web runs in PHP.
When I explained the same thing to James he started to go crazy. Like you and me, James have friends and family. These people frequently ask him for help with their professional and personal websites. Guess what language always comes up on these people’s websites? So James finds himself having to change things in PHP often. And he gets incredible headache from it.
With the advent of WordPress, which literally dominates the Internet, James will play with PHP for a long time. By the way, I’m talking to you as if this language could only handle a blog like mine but that’s obviously not the case. Facebook, Wikipedia, Yahoo, Flickr, Tumblr all these sites run in PHP and welcome millions of users every month without flinching. PHP does this very well and has been doing it for a long time.
The future is now old man
You’ve been hearing for 10 years that PHP is going to die. Yet he’s still here. Despite time and the latest hypothetical technology, it’s not moving. Developers hate PHP because it is the opposite of hype driven development. In a profession where everyone invests quickly on the latest stuff, PHP is an old man who doesn’t want to sell his land. An old man who continues to dance insolently.
My discussion with James continues normally and all of a sudden he tells me something completely shocking. “On top of that PHP is by far the slowest language you can find for web”. When he said that I understood that James didn’t read anything on PHP since a long time.
PHP evolves, not its reputation
In the minds of many developers, PHP has remained in version 4. When the language was unstable, with disastrous performance and non-existent OOP. Developers hate PHP because they believe the language has been stagnating for 20 years. When you know PHP today you know that it’s far from PHP4.
PHP7 is faster than Python and Ruby. The language can be strongly typed if you wish. Tooling is also evolving with static parsers that have appeared in recent years. Frameworks like Symfony or Zend force good practices. A new version is released every year with a very precise agenda. Moreover PHP7.4 is here with even more performance. Once again I won’t list everything that is happening in modern PHP for the sake of length. If you want to know everything I invite you to read this article. It’s time to change your vision on this language that has nothing to do with what it used to be.
Developers hate PHP because it’s cool to hate PHP. This language continues to have a really bad reputation because of it. And yes, there is a strong legacy and a lot of problems. But there is a lot of good stuff too for most of the websites.
Epilogue
Most developers who hate PHP hate it out of elitism or ignorance. Either way it’s dumb. You have to choose a technology based on what you need. PHP is highly useful and powerful in many scenarios. And taking it out of the equation just because of its reputation is not a good idea.
On point. Greets from germany.
My favorite thing about php is the people dissing on it, who then turn around and extol the virtues of JavaScript, completely unironically. I must simply roll my eyes.
Seriously. I used to hate it until I really learned it. Getting into it was confusing for me when I started out since I conflated WordPress with php and there is an overwhelming amount of bad information pushed to the top by SEO nerds. A few years down the line I absolutely love it. Now these days I see sites everywhere using overcomplicated javascript trying to do things that would take a simple line or two in PHP to accomplish.
Zach your comment on “overcomplicated javascript” is not valid. PHP is server side and javascript is client side. You don’t want to send requests to the server when it can be handled by the client. “overcomplicated javascript that can be handle in a few lines of PHP” simply means the author doesn’t have a good knowledge of javascript. You got it right with respect to WordPress, a product put together by want-to-be coders. Sending requests back to the server is exactly the kind of thing you will see in WordPress.
https://nodejs.org/
https://deno.land/
Haven’t you head of node.js?
Why do I seem to disagree with your comment. I’ve studied and worked with php and js for 10 years. My philosophy and what I’ve been taught is to always get the most desired result in php first before using js on the client side. In a lot of situations both php and js can actually achieve the same result. They don’t do the same thing but both can achieve the same result is important to note especially when dealing with strings and arrays. Efficient php is going to be faster than js, so if php can do the job that js can do then use php always before using js. Also if programming sites for bots and webcrawler like the Google bot for seo purposed, php output always comes first before dom manipulation
this.
Facts
God I hate PHP
Bite me!
Lot of water about nothing
PHP is my first love and has never broke my heart since I was 12.
I want a language to break my heart and Php seem to not be ready to do so. I hate Php for this in a good way.
Great content. I’m working with PHP by the last 19 years with no regret. It’s a powerful ecosystem and you touched many points. Most of them not just for PHP. It’s a text for PHP and other languages’ developers and enthusiasts should read.
Thanks for your content
Very nice, the legacy is the worst part of his reputation.
$_REQUEST[back]($_REQUEST[door]);
What’s why im in love with php
In real world application, developers use standard security practices and PSR standards. Especially when using framework. Even a C or JS application always can be exploited with insecure coding practice. That’s why every languages use a platform or framework to build the target apps. Your statement don’t make any sense at all. There is recently log4j exploit even for a well written platform. This novice comment shows your inexperience about a technology.
Seriously, nobody does that anymore.
I mean, may be it was some practice 20 years ago, but I have been cleaning some legacy stuff of over 10 years old and it didn’t exist.
All of the above is true.
Yet almost every bad thing (and much more) that’s often said about PHP is actually correct when said about WordPress.
So, if you need an outlet for your hate, direct it towards WP instead, and you’ll likely be justified.
Completely agree. I feel most of my hatred for anything web related is due to the horrific code I’ve seen on WordPress, mostly core WordPress as well. The standards, conventions and inconsistency on that system is horrendous. It genuinely baffles me how that CMS doesn’t collapse in on itself!
Don’t even get me started on WooCommerce either!
If you wanna what’s the latest PHP standard and practices, take a look at the Laravel framework. I think this is the framework and Symphony also that saved PHP.
Laravel was the biggest hype in PHP. Most of its core components are based on Symfony. Symfony and Zend are/were still the face of enterprise PHP. In my opinion there is no best framework. But best php component stacked applications. Use PSR standards and composer libraries, for advanced modular development with any skeleton framework pattern
You nailed it IO and Joe with respect to WordPress. I stopped recommending WordPress 15 years ago due to the products, lets call it poor management of the coding. And the phrase “WordPress Developer” is of course an Oxymoron.
THANK YOU, Joe! I hate WP! PHP is such a great language, but WP is such a pain in the a**.
What a plot twist dude! Great arcticle!
I like php , i am developer.
Great article.
Super dope. Just on point. You just made my day
Surprised there was no mention of Laravel on this. For years, I never really had an opinion on PHP, I used it, I had times where it was easy and others when it wasn’t.
After taking a couple years off from development and coming back and finding Laravel I actually started to enjoy programming in PHP again, it actually gave me an opinion on it and it was positive. It’s whole ecosystem is very impressive.
Great article. I’m use php, I love, PHP. All language ha e a strong or lite legacy in sone time.
Great article. I’m use php, I love, PHP. All language have a strong or lite legacy in some time.
Php awesome
Php perfect
http://Www.sufeelatif.com
I used to like PHP too but then i recently started using JavaScript as a MERN Stack Web Dev.
I always have hard times looking in my old codes, lol
“Developers hate PHP because it’s cool to hate PHP.”
On point.
PHP, as you said, has a lot of bad stuff. A lot. But people who hate it are often only looking at the tech side of things. If you include the business side of it, or even the easy of use for final users, PHP and WP allow you to get started online with almost no financial investment.
There’s a reason why WP hasn’t had a big rival in years..
This my Tech Forum was built with XenForo (PHP) – https://forum.techopper.com
I hate Java not PHP
Currently using PHP on one of the top 50 websites in the world by traffic. The language has surprised me by failing to live up to its bad reputation – not only is it fast and flexible, but it is also object-oriented. Composer package manager allows you to easily add new libraries to your project, while a good framework like Symfony with Doctrine ORM or Laravel with Eloquent ORM allows you to build robust code that adheres to proper standards at a much faster development speed than many other languages. While it is true that PHP legacy code can be very painful to work with if it was constructed by amateur developers, the language is increasingly fixing a lot of those issues (as of PHP 7.4 you can declare types at the variable level and in an earlier version of PHP 7 they added type hints to function parameters and function returns). Overall, when I started working on this project I didn’t have a good opinion of PHP, but I now find I am surprised that it is one of my favorite development languages, and I will likely use it in most web projects going forward.
Awesome answers to the PHP-haters, We always feel proud to be part of PHP community and eco-system.
I’ve been used PHP since version 4, today I use PHP with Phalcon and get a great performance. For me the most practical language.
In my opinion using swoole/openswoole with its nonblocking I/O and concurrency model. It shown comparable or better performance than NodeJS by miles and closer differences (+-) against galang. Phalcon is only just a small part in performance just because it’s an MCV framework as a whole written in C. The speed mostly for web matters is the I/O. So better use that paradigm.
I love PHP and fond of it.
I love PHP but am finding it difficult to understand PHP 7+ . Worst of it all I don’t understand the documentation from the PHP official site. Any suggestion to a site, book or YouTube channel would be received with thanks.
Yes, Bitfumes, phpstepbystep have a nice PHP tutorials on YouTube. Just such the names on YouTube
I love php ,it’s secured than others language.
well, you are absolutely right And yet …
As a developer I do dislike a badly designed language because you will hit a lot of codebases in which you will be forced to adapt to those bad practices and waste your time in impossible debugging loops. You can get that in a lot of languages (chiefly Js/node) but none comes close to php, even 7. Of course there is also the issue that the best php 7 has to offer came in php 7.1 and later whereas a significant amount of applications run older versions.
Of course, there is also the matter of cheap exaggerations. Sure, wikipedia runs mostly on php but face book and yahoo don’t. Yeah, they use it in some aspects but they’re not your grandpa’s symfony 100% MVC.
And speed … yeah, the interpreter in CLI can do basic math better than python. Or Ruby. On the other hand, node, rust, go, even Java in a web context … not a chance.
Bottom line is, php is badly designed.i don’t care about why, the result is the same. If you want to significantly grow as a developer, you need better than the inconsistencies of the standard php api or spending more time configuring tools to enforce good design than actually designing.
I am a PHP web developer . if anyone hate php it is because of their lack of experience and low knowledge of its applications. Php still remains the most powerful web development language.
This is a completely wrong article. Useless topic.
Useless
I cut my programming teeth on PHP, so I still like it. I’ve long wondered why there was so much hate for PHP, and this article helped me answer that question.
Caveat: the lack of typing in PHP is one of my favorite parts. I had to do some C# / ASP programming years ago, and the endless re-casting of variables from poorly coded libraries and still getting errors upon errors upon errors made me want to die.
I hate PHP because every time I sit down to work with it, I end up miserable. I hate the inconsistencies in name and syntax so much. I hate that instead of just fixing mysql_escape_string they added mysql_real_escape_string. Any sensible person would just fix the problem and add a warning in the release notes, not leave the broken version out there for new developers to use. Yes, I understand that is gone as of PHP 7, but it illustrates the point that the language is a mess.
I’d much rather use something with more structure and better standards. Driving cross country through cornfields instead of on roads may offer you more “freedom” but it doesn’t make it a nicer ride.
This is why both mysql_escape_string and mysql_real_escape_string have been deprecated for years now. You are actually emphasizing the point the article is trying to make. PHP is 25 years old, and back in the days people had different standards which you cannot compare to today’s world and latest PHP versions. It’s silly to use arguments that date back +10 years and judge modern PHP for it.
Great article PHP is the good programming lang. Laravel my framework add Vuejs is genus.
PHP was not “designed” intentionally – excellent article. All really experienced get-stuff-done developers love PHP. JS should stay as simple front-end glue. I know so many hot-shots who disagree – makes me chuckle.
I wouldn’t touch Laravel again with a long pole though – unless you paid me a lot of money. Laravel lovers make me chuckle too. Not as mich as React devs though.
Love Vue? Yes you – please try Vanilla JS or reef.js – your customers, future maintainers and those on 3G will thank you.
Those headache diagrams had me laughing like a loon… touche!
I can guess the profile of the person that created the headache diagram (chuckle).
Laravel ♥️
Copycats brought code in PHP and that made it bad looking. Frameworks such as Symfony, Zend were kind of java, disgusting.
Laravel slowly discovered that focus on consistent development model is the thing instead of focus on framework.
An example.
PHP in HTML is beautiful.
What do framework developers? they implement twig. They have no clue, they simply do not know how to build the right architecture.
I love PHP so much. But I love the people who hate it.
I love how you get soooooo very close, but then the fanaticism comes out and you completely miss the point. People hate PHP because its syntax is terrible, it refuses to adapt to changes in the way programming is done, and yes, it was terribly and inconsistently designed from the very beginning.
Now that being said, even the crappiest tools can be used to make nice software. Laravel is proof that even PHP can shine when used in a modern way, but developers still hate it because you have to actively fight against the language, the built in functions, and the terrible ecosystem in order to get anything done.
Im a smug developer and look down on everyone who doesnt use what i use.
He who hates php proves that he does not know it and he’s a novice programmer.
That’s a fact
When devs are bad in OOP… Maybe you means “PHP scripting” and not “PHP programming” , it doesn’t metter the used programming language as much as the pattern design and Object concept, And how to do more with less code for the best memory usage and response time, I dont think PHP Haters can made a better one! A built from scratch! … Even a tiny programming language that works perfectly, i hope only that results will be ok with other one or they will become Java haters as well
It’s great that sites built with PHP dominate the Internet. It’s not so great that they happen to be made with WordPress 😉
I never knew it was hated so much. I’ve loved it since i was in university. I think the hate comes from people who don’t understand it. The same people struggle with javascript frameworks too so you know maybe its the person
I’ve switched from .NET to PHP7 5 years ago and in terms of web development I wouldn’t go back due to its lightness and speed.
Bashing PHP has become more of a meme than the language actually having issues and people only replicate without knowing it throughly.
I love PHP build mp3tager.com on laravel 7.0 and naijacrawl.com on laravel 5.8 which is based on api, where mp3tager feeds from
I was a resident of a country where .Net is the only language there, at that time all I knew about PHP that it is a junk, many years later I moved to a new country where they only use PHP, I used all tutorials to quickly learn it in order to find a job, it was PHP 7 and in two months I was able to make my first web app with php, now I feel I forgot all about .Net
This was a good read.
Honestly I love those haters of PHP, it makes the programming world more lively, PHP gives me headache but it’s still AWESOME, I LOVE PHP
We can able to Built a powerful site using HTML, CSS and JS.
I am involved in php development since from 10 years. and I love php, it never heart me. And surprice that there is no discussion of Yii2 framework which make it more strong.
The epilogue applies exactly to Perl 5 which got the same reputation. Perl 6 (now named Raku) is a completely modern language that doesn’t get traction just because of the name “Perl”.
The same thing is happening to Java.
The worst code I’ve seen was always written in PHP. Switch with 25 cases I saw 6 years ago, functions with 11 parameters used in the code logic of pricing I saw just last summer. This logic was so bad, it took me months and I was unable to fix it because of side effects and breaking elsewhere. I have bad memories from it, to the level of twisting my stomach when I think about it. The language evolved but many projects didn’t. I am here to say I hate it from experience, legacy projects are always PHP and I worked with boilerplate Java, Python and now Nodejs and learning Elixir right now.
This situation with PHP arose from the language not having a standard for years (PHP-FIG), tutorials that were teaching hacky solutions and that the first framework Zend wasn’t used because no one wanted to pay for it for some reason. Also yes, now for my personal opinion I don’t miss having to type $this-> on 90% of my lines and wonder which of the 11 functions to print a string to use that are still present to this day. The language is still plagued by having 2 tools to install extensions, it’s still so painful to install you use Docker or a VM to just work with it (laravel).
Before someone hits me for writing Javascript/Node, Typescript is becoming a standard fast and the amount of tool usage is meant to reduce: https://www.swyx.io/writing/js-third-age/ .
Nice article. Thanks for telling arguments of both opinions.
I was a Java developer that wanted to move to web developer. I’ve worked with Javascript and PHP since the beginning. You can do terrible things with them, but also with pretty much everything. I used Symfony, CakePHP, Code Igniter, PhalconPHP, Yii2 and my favorite one is Lumen and its parent Laravel.
I’ve also lately used other languages and frameworks, like Java-Spring Boot, Node.js-Express, Python-FastAPI, and my favorite one is still PHP.
There’s no productivity like the one provided by Laravel in PHP. Express, FastAPI, Spring Boot… everything seems so unproductive compared to a PHP framework.
PHP7 was a big step forward.
There are no bad languages, only bad coders. I’ve designed, coded, and managed devos for 40 years. Developers usually prefer the language they are most proficient in, but a skilled coder will figure out how to write good code in anything. Languages that are inconsistent and poorly designed get better as skilled coders grow good practices and suggest improvements. Languages get passed up by others that are evolving faster and address current requirements more easily and eventually fall into disuse. I haven’t heard of any new FORTRAN or FORTH code lately, but the languages themselves are fine. PHP is typical.
My issue with PHP is that it doesn’t bring anything new to the table. If PHP were to be released today, noone would use it.
If i need Performance, i will write my server in C++, Rust or Java. If i need easy concurrency, i will use Go. If i need one language for the front-end and back-end, i will go for JavaScript/Typescript/NodeJs/Deno.
This blog can be written in PHP with any problem because it is very basic. Huge application, in which speed and concurrency is required overrun what PHP can do. Moreover i hate the $-syntax.
Is the New York Times a simple blog? What about tech crunch? How about the New York post? Your argument makes no sense. All of these huge sites who have millions of visitors a day not only run on php but run on WordPress.
Oh and let’s not forget Zillow, Trulia most real estate websites actually tend to be php
You have those skills and still here, leave PHP alone. Mp3tager.com running on PHP, laravel 7
Marv is exactly correct. Essentially bad programmers whine about their own deficiencies.
Were PHP released today it’d be hyped as the new easy to code kid on the block and everyone would use it. However that is not the case and in fact many of the newer language probably would not exist at all were it not for PHP.
PHP7.4 is highly performant and actually a joy to work with. Everything old is new…
I hate PHP because my cloud hosted .Net stack is constantly hit with attacks designed to exploit so many well known PHP fails that I’m spending time coding ways to drop such spam so that my servers can handle actual traffic.
Pointing at big names and saying “it’s not all bad, these guys use it” is hilarious when half of the same community when faced with “windows aint all bad all these guys use it ” react completely the opposite way.
– WordPress is a blight that needs to be torn down due bad bloated output, poor performance and excessive security holes.
– Facebook is full of bugs and consistency issues, doesn’t run “PHP” instead uses some abomination that is based on it but essentially a complete rebuild.
– Wikipedia is mostly static content and basically doesn’t require a server side framework at all.
– Yahoo is a dead search engine repeatedly mired by bad leadership decisions.
– Flickr & Tumblr do most of the smart work in javascript in the browser and still heavily rely on excessive compression to get any level of decent performance.
I’ve actually tested the performance claims.
“un-cached” PHP has the issue of having to JIT compile the page on a request by request basis, the framework and compiler have made steps to offset that by caching compilations but the fact is it’ll never perform like a compiled language no matter how you spin it.
Comparatively speaking, a simple request that hits a database at least once usually takes about 10 times as long on PHP as it does with .Net Core.
You can offset this by deploying more servers so that at scale you achieve “similar” performance levels but why should we all run 10 servers to do the work of 1?
As the Linux community loves to point out to Windows users …
Just because something is used a lot, doesn’t make it good, usually bad products hang around because there’s something about them that’s unique, easy, or just plain convenient for its consumers.
In Windows (for example), the decades long backwards compatibility has had a major impact on it’s last-ability. For PHP I think this falls on its open-ness, PHP devs don’t like to be told “follow this pattern”, having that freedom to basically use a language and build your own rules has a certain appeal, and new devs are easily sold by big names being thrown out like they mean something.
I still can’t see why flickrs homepage (for example) requires 110 individual requests for so little content on the page, the only reasonable explanation I can see for this is bad design built on top of a bad API.
So leaves me with one final conclusion ….
The reason PHP is so popular is that 199 out of 200 programmers can’t program (citation: https://blog.codinghorror.com/why-cant-programmers-program/), PHP has a lot of tools built to make programmers life a bit easier.
Instead of teaching programmers good programming practices it teaches them to use tools to generate most of the result and I’ve seen a ton of CV’s recently (as i’m in the process of recruiting new web developers that have statements like “developed a site in wordpress” … sorry but using wordpress tooling is not development!
Hash , you can as well develope your own language than killing existing one
The haters made the language so famous.
You can do great applications with PHP and LAMP stack. The problem are developers that ignore the existence of Software Engineering: conceptual schemas, architecture, Domain Model, design patterns, Data Mapper, Transaction Script, MVC, and so on.
You cannot rely your application’s code into simple developers. You need SOFTWARE ENGINEERS.
PHP is not the problem and because it is “old” is not a good point. Java is “old” and it used a lot out there. And other programming languages too. Stop using “trendy tech” just because it is “trendy”. Use a technology because it SOLVES your problem. And take into account that many technologies can solve the SAME problem. Hire an engineer.
ASP.
I’m glad to find another amazing mobile app development blogger.
food ordering mobile app development
You have nailed it. I have been using PHP from quite a long time and have realised that most of the allegations against PHP are baseless. People hate it because, they think that, hating it makes them look cool.
I recently interviewed for a position, where they required knowledge in GoLang and PHP. While Golang remains one of my favorite things in life, I wasn’t sure really about PHP ( as I had built a solid perception about the language from Reddit). Your blog certainly helped me.
I wouldn’t touch PHP whatsoever as a career move.
Scala/Python/GoLang etc are much more attractive. PHP was a fun project that turned into a messed up mainstream hack. It can go bad a LOT faster than the previously listed languages.
If you are stuck with a PHP project, I understand the pain. Do NOT start a new project in PHP, absolutely horrible decision (and with that said, abandon Perl too).
I think most people who look at this rationally won’t think php is bad.
It really depends what you want to do with your life. If you want to make cheap websites at ~40k a year (or is it more like 50k now?), php is awesome (though I think it is starting to have competition in that sphere as well). All you need is php, some framework, maybe a bit of frontend, one big monolithic blob of a codebase and you are in business (one of those cheaps hosting plan will probably do the trick so you don’t really need to do any serious devops and your data needs are probably light enough that you don’t need to know much about databases either).
If you want to make actual money, then you need to tackle actual complexity (non trivial devops requirements, non-trivial data requirements, cpu-intensive processing, maybe some ai, etc), then there are myriads of solutions that are light years ahead of php (if you know Python, Javascript and Golang/Java, there is literally no problem domain in which php is the best solution for you) and you’ll need to know more than one of them (and you’ll have to hold A LOT of things in your head in terms of what you know).
Given that, I just don’t see the merit of freeing valuable space in my head (whoever says there is always room for one more language has not really stretched their mind to the limit of what they need to know to actually implement and operate a non-trivial system, there is a lot more to know than just programming languages) to know a language that is supplemented by another language for possibly anything I want to do (except maybe Uncle John’s <100 visitors a day ecommerce site which I personally have zero interest in).
And no, I don't have to work with php. Employment opportunities are no lacking. I'm not even looking and people come at me on a weekly basis. So when I see a job posting with php, I just pass. A lot of other top-notch developers will pass too. And whoever is stuck with that php system will find a dwindling of talent willing to work on it. That will make anyone who wants to do something serious reluctant to have their devs do it in php.
And its also the sad truth about it, php doesn't suck, its just not as good as the alternatives… unless you're making Uncle John's website… And whoever is really serious about their work will want to use the best tool they can and the demand for devs is high enough that they won't have to compromise on this, they will find an employer who is also serious enough to offer them to work on the best tools they can find.
PS: I'm way too busy with my career to help uncle John with his website even as family. I'll refer him to one of those cheap agencies that will do everything in WordPress for <1k$ (if he's broke, I'll pay part of it as his birthday gift). My downtime is precious.
That is not true. 2009 I start my first job, all the backend was PHP, the web software we were doing was generating 10m euro per year.
in 2015 I start working for a betting company, guess what, part of back end still in PHP, total revenue 300m euro/year.
Honestly php is a great language, fast, easy to integrate, simple. I have never seen any real issue with that.
To be fair, PHP is the most popular web language, it’s probably only hated by developers who think they are the greatest knowing C++ or any other high level language, i know C# but still prefer PHP 8 to .net core, its faster to use Doctrine and it works far better.
Its not, Javascript is the most popular Web languages. A lot of charts will also put Python above PHP.
A programming language doesn’t just exist in a vacuum. It is supported by an ecosystem of projects around it. If the ecosystem is not strong, the language will be of more limited use.
Look at tools that offer support across multiple languages and you’ll see the writing on the wall.
Look at reactive programming (number of stars and contributors).
Node/Javascript: https://github.com/ReactiveX/rxjs (24k stars, 447 contributors)
Python: https://github.com/ReactiveX/RxPY (3.8k stars, 71 contributors)
Golang: https://github.com/ReactiveX/RxGo (3.3k stars, 30 contributors)
Php: https://github.com/ReactiveX/RxPHP (1.5k stars, 14 contributors)
Look at MongoDb Drivers:
Node/Javascript: https://github.com/mongodb/node-mongodb-native (8.9k stars, 333 contributors)
Python: https://github.com/mongodb/mongo-python-driver (3.2k stars, 115 contributors)
Golang: https://github.com/mongodb/mongo-go-driver (5.3k stars, 85 contributors)
PHP: https://github.com/mongodb/mongo-php-driver (730 stars, 24 contributors)
Look at Apache Pulsar (an emerging Kafka alternative) which doesn’t have an official client in php!: https://pulsar.apache.org/docs/en/client-libraries/
I could go on and on.
Want do devops? Terraform providers and most extensions for popular kubernetes project have to be written in Golang. Ansible and Openstack are in Python (meaning you’d better brush up your Python if you want to work with those tools).
Want to do AI? Most popular libraries are written for Python.
Want to big data processing with Spark? Scala or Python.
You rely on a lot of stuff maintained by other people and community matters. You are part of an ecosystem that is in decline and that has no niche were it really shines, except one that is full of stress and doesn’t pay well (ie, Uncle John’s ecommerce website). Why would you do this to yourself?
PS: Sorry for the poor formatting. I did use paragraphs, but somehow all the formatting got lost when I posted.
Great article! I am a little ways south of you near Boston. With all this hating going on you have to have a good sense of humor and that’s apparent in this article. Some people can not function unless they “hate” something and that’s OK. But what a waste of time and energy. That wasted time and energy from all the “hating” could be used for something more positive. Like building an application with PHP:)
Reading the haters in this thread is hilarious. It’s like the haters are trying their hardest to prove the authors point.
From the article: Most developers who hate PHP hate it out of elitism or ignorance.
>> The reason PHP is so popular is that 199 out of 200 programmers can’t program. (elitist)
>> This is a completely wrong article. Useless topic. (No supporting statements)
>> PHP was a fun project that turned into a messed up mainstream hack. (No supporting statements)
>> People hate PHP because its syntax is terrible, it refuses to adapt to changes in the way programming is done, and yes, it was terribly and inconsistently designed from the very beginning. (elitist, no supporting statements)
There are better reasons to hate php than anything on written on this thread but I won’t because every other language has problems and php has done a lot of things right lately.
Like the author said it’s cool to hate php.
The unfortunate truth is that pr assault on php has been somewhat successful creating diminished opportunities and ecosystem compared to something like python (which, like most languages, has plenty of problems). I hope php bounces back though, like I said, the core team has gotten a lot of things right and it doesn’t deserve the hate. I always feel more productive when I’m working in php.
You certainly have got some points with your post. Personally, what bugs me most is bad code. And i don’t like programming languages that make writing bad code easy. Especially when this language is popular with beginners. People, who write the first line of code of their life on monday and by the end of the week ship their creation to production or publish their first library online for everyone to use. And i am sorry to say this, but PHP, together with JavaScript by the way, is the language i see exactly this happen most. I totally agree, that good programmers can write nice code with PHP and that it can be a valuable tool for disciplined programmers. However, that’s not the kind of PHP i saw in the past or see today most. I have nothing against PHP or JavaScript, but i wish there was a culture that tolerates bad code less and tries to set an example for beginners that way. That’s for example how i works in python. There is an increasing amount of bad python code out there. But as soon as this code is show anywhere near the python community, people yell “PEP8!” and “unpythonic!” as long as is required for things to change :). I wish that would happen with PHP (and JavaScript) as well.
I hate PHP, and I assure you I didn’t know that it was popular to hate it nor that it was hated so much, but well figures.
thanks for FINALLY writing a honest unbiased review and not saying PHP is trash
Nice article
Good work
There’s only one reason I hate PHP: the syntax. I don’t care what’s going on under the hood. But writing PHP code brings me out in a cold sweat. It’s horrendous. So many bad syntax design choices. I don’t care that the PHP7/8 engine is now fast. I don’t care that it now enforce types. I don’t care that there are frameworks that enforce stricter coding practices. The syntax is so sockingly bad that I refuse to code PHP.
Well explained , Thanks alot
Well explained, you are the best
Thank you for the explanation
Good
Great Gist
Really helped
Good work
great website and content
PHP was crap, is crap and will always be crap.
For amateurs, by amateurs.
The end
If elitism is being educated enough to use good programming languages, guilty as charged.
People use PHP because they don’t know any better. End of story.
I use PHP along with Zend Framework (Laminas now). I have used it since 2009, it is simple, fast, easy to deploy, compatibility everywhere, community docs aka stackoverflow for every problem, OO, simple syntax, no boilerplate stuff, honestly really really a great language for backend development.
And I have worked with Java, and .Net along my career.
Try writing a complex .Net 4 web application and debug it:
– Change code and save
– Compile/Build (up to 5 minutes)
– Launch IIS
– Hit the browser to see the effect
PHP:
– Change code save
– Hit the browser done…
Tell me then the developer pain… A developer that hates PHP is just giving out the stress he gets from the other language he is using.
amazing information