There have been quite a few, “hate on PHP” articles being posted lately it seems as though the let’s hate on PHP train rolls around every couple of years and the hate articles come out to play. This recent article got a lot of attention, it was well thought out and well-intentioned somewhat but that one single post spurned a new-found hatred towards one of the webs most popular languages from other bloggers.
One of those such posts is this article which was intelligently titled “Why PHP still sucks, even if you like it” written by a more than obvious Ruby fan-boy with a raging hard on for Ruby.
The reality is PHP does suck in comparison to other languages like Python or Ruby, but does anyone seriously care? I sure as hell don’t. PHP is my bread and butter, I know it basically inside and out, it gets shit done and gets me paid from my employer and freelance clients.
I’ve never once heard a client say: “Please build the site using X language, PHP sucks!” all clients care about is a result, all a company or freelancer cares about is getting paid so they have food to eat and a place to sleep.
Comparing programming languages to one another is the equivalent of a nerd dick measuring contest, except everyone has a small dick and nobody has the balls to admit it. Unless you are trying to achieve something specialised, any web language will be up to the task.
The one thing I love about one of the suckiest web languages around is there are next to no issues deploying PHP on any web-server (with exception of the odd outdated version of PHP being used by a host). How many other web languages around can say they can be deployed with next to no effort or issues on almost any web-host without having to install anything?
I’ve never encountered a problem PHP couldn’t solve and although some solutions in PHP might not be as pretty or efficient as other languages, I could care less. The arguments that PHP is an ugly language are half-truths, PHP only produces ugly code if you suck at coding and don’t care how you go about things, it’s easy to keep PHP code clean if you care.
PHP is cheap to host, cheap to find decently priced & skilled programmers and quick to code in if you know what you’re doing and at the end of the day what does your client truly care about; a final product that can be deployed almost anywhere cheaply, can be modified by one of the hundreds of thousands of PHP developers out there or a final product that might cost more to deploy, can only be worked on by someone who will most likely charge more than a PHP developer but the code-base looks cleaner?
Don’t get me started on the misinformed statements about scaling, security and compatibility. PHP is one of the most mature web languages around and while it might not enforce strict coding guidelines and set ways of doing things (like function naming and indentation), there are certainly no issues you’ll come across that are the fault of the PHP language itself that will prevent you from deploying something awesome cough Facebook cough Wikipedia cough a lot of Yahoo! projects cough WordPress.
People who call PHP a bad language are merely wasting their time stating the obvious, many people who use it (like me) acknowledge that it sucks, the ability to mix HTML and PHP alone makes me vomit inside of my head.
What more proof do you need that people acknowledge PHP sucks, but serves its purpose well other than the fact that the worlds most popular blogging application WordPress is coded in PHP? Have you seen the WordPress code-base, it sucks, it’s a mixture of backwards compatible code, a retarded inception of spaghetti code, procedural code and object oriented code being inconsistently used throughout the application (sometimes both styles in the one file) and has any of that stopped it being the number one blogging platform, no. And you know why that is? because most people don’t care how shitty PHP is.
So, while you all bitch and moan about how bad PHP is, writing blog posts that nobody cares about I’ll be making easy money and stealing your clients. Remember to keep warm, the streets are cold and mean.
if all you do is shovel around some webshitcode, then php is the best choice, no doubt.
I was once like you, doing PHP for bread and butter and let me tell you it blinds you.
PHP sucks, so what? So when your clients start losing data because your save form was poorly coded, then what. So when your clients start turning to competitors because you can’t even find the error in your code, then what. So when your company is sued for writing insecure code, then what.
Compare PHP to other languages like you compare the methods of building houses. PHP is the cheap way with cardboard boxes and duct tape, it’s easy to deploy because there is no structure to deploy.
What your client doesn’t know is that they’re getting an elaborate cardboard box, and you’re not telling them because it’s cheaper for you to produce. If you ask me, that’s close to swindling.
“PHP might not be as pretty or efficient as other languages, I could care less.”
You COULD care less? Because that means you do care.
Bravo, I couldnt agree more with your article, like as if the client gives too shits what language you use, aslong as it does the job, does it fast and secure too! Wonder how many people landed at Facebook and said ‘ah shit its in PHP, I aint using this’…NOBODY! IDIOTS!
@LE: Wut? Sounds like you’re describing a bad programmer – not the language.
@LE,
Ever heard of the old saying a bad mechanic blames his tools? You have just as much of a chance losing your data no matter what language you program in. There is nothing wrong with coding in a language for the sake of making a living because you find it easy, PHP still challenges me on a daily basis and I don’t think my employer or clients would appreciate something coded in a language I don’t truly understand. With PHP I stick to tried and tested frameworks, if you’re coding from scratch in PHP the chances it probably will be riddled with bugs and vulnerabilities are quite high but if you’re using a framework like Codeigniter or Zend amongst others, then things like handling forms, interacting with databases and securely working with user data are non-trivial things.
Your analogy of building houses is flawed. You’re basically saying if a bad builder constructs a house out of good materials then the house will be better quality than a cardboard house constructed by a good builder who understands the caveats of the material he has chosen to use to build the house. A decent builder would never choose cheap materials to build a house just like a good coder would never choose an insecure framework to build a website for someone. Any web language is going to be insecure and susceptible to buggy behaviour and exploits if the coder sucks, PHP being easier to learn does make it easier for newbies to create insecure sites but if you’re asking a newbie coder to make you a site then you deserve to be hacked.
Agreed, customers don’t care and you don’t give a sh** as long as money comes in. PHP gets the job done.
But I’m much more productive with modern alternatives (be it django, RoR, grails, …). This means I can have lower pricing, hence more contracts, or I simply get the same amount of money for less work. Which is good.
Hosting is irrelevant for any serious project : even if it costs you 30$ a month instead of the cheap PHP standard hosting, it’s roughly 300$ extra a year. If I can save a few days coding thanks to the added productivity, it repays itself.
That is, unless you only have “poor” customers asking you for 2-3 pages websites and who can’t afford an extra hundred bucks for hosting. Boy, I wouldn’t want your job.
And do not forget modern frameworks make you feel good and keep you healthy, while PHP makes you a dull person.
http://www.xkcd.com/353/
😉
@What Haveyou
Haha, I just meant I could care less about the shortcomings and aesthetics of PHP, but instead of caring less than I already do I’d just prefer to code and make money instead.
Agreed. PHP may have more than its share of warts but it has no issues that can really be considered show-stoppers. Compared with some other languages, it may take a little more of a conscious effort to write good, clean code but only a little. Does that sound like a ringing endorsement? It’s not. Use whatever you want but don’t complain about others’ choices.
To all who replied to me saying “oh but the programmer is to blame if anything fails” — no, you don’t understand. The argument presented in the article is that PHP does suck but that doesn’t matter. What I say is that it does matter. You’re ignoring a very important aspect of programming, and that is choice of technology.
Choosing PHP speaks volumes about what kind of project you’re doing.
> PHP […] might not enforce strict coding guidelines and set ways of doing things (like function naming and indentation)
You have absolutely no idea what you are talking about, do you.
@Dwayne, he meant that you probably intended to write “I could NOT care less”. “I could care less” makes no sense and just looks like sloppy writing. It’s a common mistake.
Deploying a simple little site is fairly easy — moreso when somebody is handling the hosting for you — but have you ever tried to host a busy PHP website on your own server?
It’s likely you have but in my experience it’s one of the the most difficult and tedious processes I’ve ever been through. Optimising PHP with limited RAM is hell. Part of that is likely WordPress’s fault but it has tainted my view of PHP completely from just thinking it was a horrible language that I had to make do with occasionally, to now when I realise it’s just horrible throughout.
And yes, I’m further baised by moving onto Python/Django where so much is done for me. It handles all my database IO through a lovely ORM, it’s compact but usable and hosting it myself is just a few lines of code that I replicate for each website. The result is something that uses 30-50MB of RAM, scales of hundreds of concurrent users and keeps going lightning fast. None of which have I been able to accomplish with a like-for-like PHP website.
(I fully accept that Python and Django aren’t perfect either but for proper dynamic websites and webapps, I’m yet to find anything better.)
And your CSS needs some serious love.
Why don’t comment paragraphs have any margin or padding? I’d suggest “0 0 1em 0”. And your links have almost no contrast from the body text. There’s a reason the defaults are blue-with-underline: they stand out and let people know there’s a link there.
Oli,
Thanks for the tips dude, but the CSS and whatnot comes with the theme I’m using called Codium Extend – http://wordpress.org/extend/themes/codium-extend. It looks like shit, but until I find a better theme that doesn’t require me having to waste time design and code it up. I might revert back to the default 2011 theme actually.
Why didn’t you read the “PHP: a fractal of bad design” article? http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/#dont-comment-with-these-things “Don’t Comment With These Things”
Would have saved you the embarrassment.
You can get a decent pay check coding PHP alright. However, having to work around shortcomings of PHP on a daily basis is frustrating and no fun at all – and I don’t want to become a frustrated and grumpy old coder much like the mainframe dudes in the 90ies have. Label me a fanboy, I don’t really care, but know that you miss the real point by doing so. At the end of a working day, I love the feeling that things have fallen into place – much like a carpenter when he builds a beautiful wooden armoire. The best I can expect from PHP is to get a working application. But there’s rarely any reason to be proud on the actual code due to the mentioned shortcomings and not the coder’s skills.
Broad, but true generalisation: PHP developers earn less, simply because it’s a language every college student and his dog knows. I can find reasonably competent PHP developers for next to minimum wage if you’re willing to trapse around Universities and find willing undergrads, whereas developers for other languages are far better sought after simply because it’s a healthier supply:demand ratio. More money, too.
TL;DR: That last paragraph… yeah, notsomuch. Still, your experience may vary.
@I Know Better
Yeah it might have saved me the embarrassment if I posted everything in my article in the comments section of that guys blog post. My blog post was not in reply to anyone’s articles about hating PHP, it was merely a directionless article acknowledging that PHP is a bad language, but a language that gets things done even if the results are not as shiny as Python or Ruby.
@svoop
It’s true, even though the PHP industry is flooded with a lot of developers you can still earn a decent amount of money if you’re decent. I know people who enjoy PHP, and while I acknowledge it’s a bad language, I don’t hate it or shudder every time I use it. I stick to trusted PHP frameworks that I believe give me the ability to develop something just as fast and secure as any other language in PHP. Sometimes PHP does get boring because it can be too easy to build something that works, if there is no challenge you undoubtedly will get bored after a short period of time. Luckily in most of the projects I deal with, there are still sometimes challenging front-end issues with browser compatibility in CSS and complex JavaScript.
@TrojanCentaur
That’s a somewhat half-truth. A PHP developer with 3 or more years commercial experience can earn pretty decently even in a over-populated field as long as you’ve got the skills to back it up of course. You can definitely find skilled PHP developers for a pittance, I’ve hired cheap PHP developers before to undertake work for me on projects with limited time-frames, saved my ass and didn’t cost me that much at all.
Your statement about the supply/demand of developers who know other languages kind of sums up why the appeal of PHP is so great even though other languages are fundamentally better. It’s cheaper to hire developers to code something in PHP than it is to find a developer who knows something like Node.JS or Ruby.
It’s human nature, if there’s a cheaper option and you know it’ll work people will most likely choose the cheaper option most of the time. And where does that leave the poor Ruby developer who just got undercut by a PHP developer willing to code it for less? The PHP developer might not earn as much as the Ruby developer if the other developer won out, but he’s going to get paid and the Ruby developer gets nothing.
Be happy with PHP and let other be more productive and have all the fun with modern tools.
Customers don’t care
😉
Absofuckinlutely !!! Great article… noticed too lately there were articles round about php and sucking, first of all I enjoy workin with php, second it pays my bills… love+money ffs !!!
Deployment to Heroku. Literally ten times faster then PHP deployment, using http://FTP...
@LE – you’re absolutely clueless. It’s awesome watching you dig yourself a little bit deeper with every puff of flatulence that comes out of your mouth.
Keep firing, assholes!
Facebook has their owm compiler for PHP that produces much more efficent code than your regular stuff. You can not compare your regular php with the regualr stuff out there. Not apples to apples.
A lot of the same things could be said about the C language – we all understand its shortcomings by now, but it’s everywhere, it has a knack for not going away, everybody knows it at least a little, and it gets the job done. But these things can change over time. Just as there is a whole generation of programmers now who have never done much C programming, there will be a generation of web programmers who have never coded much PHP, because there are now alternatives. One of the strongest incentives for coding your next project in PHP is knowing it already. That incentive doesn’t exist for someone who doesn’t know it.
Do people not realise that a service like Heroku which can make deployment of a Rails app painless is creating another problem in itself. I am almost willing to bet most people who use Heroku have no exit strategy whatsoever, what happens when Heroku is no longer a viable solution when your app explodes? No exit strategy from a managed infrastructure service and you’re doomed. Kind of a flawed argument in the deployment speed race.
I’ve never had to use a third party app like Heroku to deploy a PHP application quickly. I can easily deploy a LAMP environment on a server in 15 minutes, with Amazon EC2, 5 minutes.
@Gr8 1
Facebook weren’t the first to build a PHP compiler. Ever heard of Phalanger? It compiles PHP into CIL byte-code. In Facebook’s case a site with around what 500 million daily users makes sense to compile to something fast like C++. For most people they’ll never encounter issues with PHP performance like Facebook has, and in reality FB worked quite fine before HipHop was even used in production. It takes years to build and fine tune something like HPHP before you go implementing it into the worlds most popular site.
Great discussion guys, Thanks for contributing!
xaxa such useless post I read, spent 4 minutes for nothing
Maybe your problem is it took you 4 minutes to read my post… It’s so short it should have taken you maximum 2 minutes dude, you need more protein shakes bro. Lift some weights and then come back and try reading it in a lesser amount of time.
@LE
You are 100% correct. People use PHP because they are untrained and programming is magic to them.
I have a MS in CS and out of the many hundreds of fellow professionals that I have met, none would ever consider PHP for any type of project.
Not one,
PHP is written by people with no clue about computing, it is no surprise that all of its users are the same.
If you use PHP you have no business writing software, either as a hobby or “professionally”
@mike
You’re an idiot.
Just realised what Mike said, what an asshole. Excuse us PHP developers who don’t like writing overly complex lines of web code that require propriety debug tools and editors to detangle issues when shit fucks up.
Like I said in the article: PHP is for getting shit done, regardless of the purity of the code itself. Visitors and clients don’t care what it’s written in, if it works, it works. I’ve never ever had a client tell me they prefer a particular language over PHP, if it does what they asked for and does it well which PHP is capable of providing, I don’t see the advantage of another language.
Programmers who obsess over what programming language to use are the ones that scratches their heads in disbelief when their applications break because they forgot the one important aspect of a web application is the database.
The one bottleneck of any application regardless of language is the database. It doesn’t matter if you use Ruby on Rails, Go, Django or Node.JS you will eventually get to a point where the performance of the code itself becomes irrelevant.
Here are quotes from Rasmus Lerdof.
“I really don’t like programming. I built this tool to program less so that I could just reuse code. ”
“I was really, really bad at writing parsers. I still am really bad at writing parsers. We have things like protected properties. We have abstract methods. We have all this stuff that your computer science teacher told you you should be using. I don’t care about this crap at all. ”
“There are people who actually like programming. I don’t understand why they like programming. ”
Here is one that shows why PHP was built up badly and haphazardly
“I’m not a real programmer. I throw together things until it works then I move on. The real programmers will say “yeah it works but you’re leaking memory everywhere. Perhaps we should fix that.” I’ll just restart apache every 10 requests. ”
Yeah, PHP is written by professionals for professionals.
PHP is for amateurs that hack on something until it sort of works. Yeah, if you are self-trained and don’t have the first clue about what happens behind the scenes, PHP is for you.
Otherwise their are dozens of superior web solutions: Python, Ruby, Java, Scala, Clojure, Smalltalk, Haskell, Lisp, OCaml,C#,F# to name a few. Even VB is far and away superior to PHP, and VB sucks pretty hard.
@Dwayne
Of course you don’t care about quality code. You are a self-trained practitioner of black magic.
That’s okay the creator of PHP doesn’t care about quality code either.
If I had my way, programmers would have to be certified like Engineers before they can be allowed to create any public facing code. That way idiots like you and the author couldn’t do any damage, and PHP would not even exist.
PHP is broken by default, its boolean eval is broken, its object model is broken, it is impossible to write PHP code that is not hackable.
Wow Steve, wow. Talk about classy.
The argument here is it doesn’t matter if PHP is hacky or shit, or improperly thought out and lacking in features and design best practices: it’s easy to build stuff in PHP and get paid. Unless you’re a code purist, does it really matter you’re using a language that many like yourself regard as crap and poorly designed if it gets results?
My clients don’t care about the language, they care about results and although PHP might not be as hip as Ruby, pretty as Python or as edgy as Go or as old and highly regarded as Java it still serves a purpose and always will.
You say PHP is horrible and that’s definitely not a secret, but the likes of WordPress have built a very profitable and likeable business around this broken language (evident by the fact it’s been the dominant CMS for years now and will be for the foreseeable future). Do you think WordPress would have been as popular or successful if they used Python or Ruby?
Whilst PHP may not be the nicest / cleanest / most beautiful language out there, it isn’t bad and has steadily improved, however I’d say the biggest flaw with it is in the area of frameworks and the lack of standardization.
Most other languages used for developing web sites / apps have one dominant framework that is the standard, if someone sends in their CV for a position as a Ruby web dev, it is almost a given that they will have knowledge and experience of RoR, compare that to PHP where you have Zend, Codeigniter, Cake, Symfony, Yii, etc, then Drupal & WordPress, having so many frameworks is just counterproductive.
I’d also add, that whilst there are some very good PHP programmers, I do find teh the stnadard overall to be lower than for other langauges, the highlight of which is some of those who call themselves “Drupal Devs” and can barely manage to do anything in actual PHP.
In regard to the performance of PHP, whilst it is not up to python, etc, it is actually fine for most web apps, even very large ones if they can make reasonable use of caching. I’d suggest the problem is not PHP so much, but that some of the most popular software is not well written and not really concerned with performance (Drupal & WordPress for instance).
“Ever heard of the old saying a bad mechanic blames his tools? ”
LOL
You really don’t know what that saying means.
It means that a bad mechanic doesn’t know any better and will use the wrong tool and low quality tools.
A good mechanic uses the right tool for the job and doesn’t skimp on quality.
Someone using PHP for anything means he is a shitty programmer because he doesn’t know any better.
Maybe it’s open to interpretation Biff, but I’ve always interpreted that saying as, “A mechanic who doesn’t know what he is doing or talking about who fails to do a good job because of his lack of knowledge or understanding will blame his tools instead of himself” — there’s no need to be an arrogant asshole for no reason.
“Someone using PHP for anything means he is a shitty programmer because he doesn’t know any better.” there are a lot of companies out there who would disagree with that statement. WordPress has the highest content management market share and it’s written in PHP, the internals aren’t pretty but it works well and can be optimised very easily. Are you saying those who use it don’t know any better?
Windows is the most used desktop OS but it sucks and most of its users don’t even know why they use it, if they even know it is Windows.
argumentum ad populum is a fallacy
WordPress is a steaming pile of spaghetti shit. People who use it don’t know any better and couldn’t write a simply HTML page from scratch.
I have yet to see a well-written PHP application. There are two reasons for that:
1. It is a lanaguage for amateurs
2. Unless you you really know what you are doing it is next to impossible to write solid PHP, but if you know what you are doing you won’t use PHP.
PHP is dogshit written for morons who can’t learn how to program. Deal with it.
It was created by a non-programmer that disposes the profession and doesn’t care if his programs crash every 10 minutes. If you actually want to use something created by him go ahead, just stop crying when people point out that you are a moron.
err disposes === despises
The saying is that it is a poor craftsman(not mechanic) that blames his tools and it is correct that good craftsman knows better than to use substandard tools and materials.
Give the best furniture maker in the world a small handsaw, a rock, glue and particle board and tell him to make world class furniture with it.
It is true that the great craftsman will do a better job under those conditions than an average one, but the results will still be substandard.
Just like PHP which is substandard through and through.
Even if we misuse the statement like Dwayne and use a mechanic, a good mechanic will use good tools at work and at home because he knows better than to use low quality tools.
The usage of PHP is the mark of the amateur programming and mention of it on a resume is an instant non-hire. I hire programmers who know enough to know that PHP is terrible and should never be used.
Actually i only see a bunch of snobs talking about how bad is PHP. The same kind of people that said shit about javascript 10 years ago and now are sucking nodejs’s dick. PHP its just a tool an you use it because it works, because is easy and because it bring’s food to your table. if good that you people are such wonderfull programmers but are you forgetting this is a business we are talking about?? you people talk shit about the tool but you cant talk too bad about the house. is somehow like the comunist whine shit about the capitalism while the whole world adopt’s it
@Zetac,
Your post would have been better if you had made it intelligible.
People with inferiority complexes think that something that they can’t comprehend(why programming language design matters) is snobbery.
Shoveling shit all day pay enough to eat also. What is your point?
PHP is shit
MediaWiki is shit
Drupal is shit
Joomla is shit
Wordpress is shit
phphbb is shit
SmfForum is shit
They all are tangled mess of rotted spaghetti and shitballs.
The fact is that you are not educated enough to know not to use PHP and have absolutely no qualifications to say if it is good or not.
Programming is a professional occupation. If you are too lazy or stupid to get properly educated then get the fuck out of my profession and go work at walmart or something where you can’t hurt anyone.
@wtf? why do i allways get the dumbest of them all?
You said that my post is not intelligible and can we give a nobel to your answer?
so in what part of my post says that i’m not aware of design or architecture in programming. im sorry but for one who says to be not dumb (as i am) and educated (as i am not?) where is your logic and intelligence that i can not see in your post?
let me explain my post for dummies like you. (you gave me proof of it):
what i said is that PHP and its community is a lot more than good or bad code and that for the more importants things that does not even matter.
Now let me explain your post for dummies:
yadda yadda yadda blah blah blah shit bla blah b lah programming is mine and your dumb*
now go and read it again if you can understand it in the way i explained then if you want i dare you to show how more prepared and intelligent are you than me (i doub it a lot) (you gave me proof of it).
By the way you saying that Drupal and WordPress are shit make laugh so i least your stupidity is fun you should not be a proggramer you do better as a clown
Thanks for proving my point. You think drupal and WordPress are good. Even the dumbass dwayne knows they are shit.
You don’t know enough to make any claims
i will answer you because my momma told me to be polite even with stupid people. but i’m not planning to do so again. you are the same kind of stupid people who use to think 30 years ago that because you know about programming you are a smart ass but seems you are not. i challenged you to demontrate that you are better prepared in this field than me be you didn’t do it. that way this discussion would have been objective or with any meaning, know i’ll be just going down your stupidity level. so i quit. have a good day sir and try to read some books before writing again .
PD dont botter in answer this i will not follow up any more, i have a strict policy of just argue with smart people