Oct 21, 2010
Ewww, You Use PHP?
Lately here at MailChimp we’ve been trying to bring in more developers to help us keep the innovation coming fast and furious as the application grows in scope and scale. It’s always been difficult for us to hire really good developers, just because of where we are. Our office is here in Atlanta GA, not exactly a hotbed of cool startups in the last few years. On top of that we’re fundamentally an email company, which is far from a sexy problem for geeks to sink their teeth into. But the biggest negative reaction we get when hiring new developers is when we mention the programming language we use.
Ewww, you use PHP? I thought you were cool!
Yes, I’m afraid we have to come clean. We use PHP here at MailChimp. For the non-programmers among you, PHP is a programming language that is extremely popular in dynamic web sites and applications. Even this blog is written in PHP. Despite its popularity, PHP is considered by the programming elite, almost without exception, as one of the worst languages currently in use today. The term "good PHP programmer" is considered an oxymoron. Yet it’s the primary language we use here for development, and it’s the only language we use for everything touching the production MailChimp application. You can imagine the horror and surprise we see when we try to tell a good developer that we use PHP to solve cool and interesting problems.
So here’s my best answer to that.
We’ve built a framework for developing applications in PHP specifically designed to allow for fast innovation in the high-load, high-performance environment we live in every day while still keeping the API extremely simple to deal with. This isn’t your grandfather’s PHP, or even your slightly older brother’s. I can say without doubt that it is the most sophisticated framework for this environment that I’ve heard of except for perhaps what Facebook uses. Our architecture is heavily sharded, fast, and scalable to handle the absurd amount of growth we’ve had in the last few years.
We use this architecture to process well over thirty million emails sent by tens of thousands of users every day*, generating tens of millions of bounces, opens, clicks, and unsubscribes that all need to be handled in near-real time. We further process millions of API requests and millions of subscribes and confirmations every day. All told, we handle well over 500 million dynamic page views a month. Our backend systems run millions of jobs every day, calculating statistics, querying geographic data, and scanning everything for bad behavior and abuse.
We handle all kinds of users, from small groups with lists in the tens of emails to huge multi-million subscriber lists, sending anywhere from yearly to multiple times a day. On top of that, we have to process detailed segments and analytics, allowing our customers to slice these hundreds of millions of people in completely unpredictable ways. This is just going to get bigger and bigger as we grow by 500% or more every year – adding new features every step of the way. And that’s not even touching the deep infrastructure for actually sending the emails or filtering for fraud, abuse, and spam.
And we do all of this in PHP, which is really pretty cool. It’s true that the platform wasn’t really designed for what we put it through and it hurts us from time to time, but that is to be expected. Once you get to the scale of computing we’re at, the language you use is much less important than the platform you build on it. A simple language change isn’t going to make these problems less complicated, or less awesome.
So before you jump on that bandwagon thinking nothing interesting could possibly be done with PHP, think of us (or Facebook). You might be missing out on something great.
* Update (12/9/14): We’ve grown a lot since this post was written 4 years ago. Currently, our 7 million users send 400 million emails every day, which works out to just north of 12 billion emails a month. And yes, we still use PHP.
ivan
try doing everything is Classic ASP… now that is a language! =]
10.21.2010
Troy Tabor
Classic ASP is certainly my preferred language!
10.29.2010
Jason Spencer
Wait… What? Forgive me, since I live in Silicon Valley, land of the start-up-and-collapse environment, but why do people really think that PHP is bad?
I was usually better at design than coding (I don’t consider HTML and CSS “coding” – but I do that well). I have touched C++, Pascal, Java, PHP, ColdFusion, ASP, Python, BASIC, and even an old IBM language called REXX. The only two that *EVER* made sense to me was PHP and ColdFusion.
Unfortunately, the cost to run CF is astronomical, so I learned just enough PHP to help me get around whatever I was working on. Most recently that’s WordPress.
PHP 5.x is stable and gets the job done. It’s cost-effective, and I’m surprised that, even in Atlanta, you have an issue.
If I could hack it, I’d work there. But I’m a designer. Keep on with the PHP, please.
10.21.2010
.jonah
Jason,
I’d invite you to checkout CFML (the language) again. These days we have some great Open Source engines including http://www.getrailo.org/ and some really wonderful modern frameworks to work with.
Cheers,
.jonah
10.22.2010
Ryan
lmao
10.22.2010
Personne Moyenne
Thanks, Ryan, for your insightful comment.
10.23.2010
Great Dental Websites
I’d 2nd the endorsement of Railo (getrailo.com). We’ve used railo as our application server for years. It’s stable, simple, fast, and free. Plus, it’s open source.
If you were turned off in the past by Coldfusion due to the cost or bloat, give Railo a try.
07.19.2011
John
Because they’re nerds, dicks and lamers. They’re the incapable kind who can’t get things done because of being fussy about not having their favorite this-or-that. Imagine a carpenter not being able to work without having his favorite hammer or favorite saw around. Incapable.
07.19.2011
bill weinman
@Jason — that’s because you’re not a programmer. For a programmer who writes code because it’s fun and exciting and compelling, PHP looks a kludged-together hodge-podge of bad ideas all patched together with no rhyme or reason.
It’s also the most popular language for web programming because it’s run time is fast and (mostly) reliable. So I use PHP a lot, as do most programmers working on the web today.
It’s the language we love to hate. :)
//B
10.26.2010
hafizan
yes for web i prefer only both 2. cf and php
07.20.2011
DigiGifts
Absolutely nothing wrong with PHP, coming from a PHP web developer. ;-) Love the open source platform!
10.21.2010
David d
Interesting. I’m no programmer, but if PHP is such an “unsexy” language to be using, what language would a “sexy” programmer use to run Mailchimp?
10.21.2010
Sam Lawrence
I think these days, everyone’s considering Ruby to be the new “sexy” language.
10.22.2010
Anonymous Coward
Ruby’s just cute.
10.22.2010
Gérard D'Abboville
> We’ve built a framework for developing applications in PHP
Seriously? You don’t even use an opensource one?
That might be the real problem in the PHP land, every single dev or company seems to have built its very own framework while there are plenty available in an OSS fashion…
Anyway, good luck sticking with it, I personally moved to python and django and am perfectly happy with them, far more than with php.
Anyway, never mind the bottle, let’s just drink it
10.22.2010
Derek Gathright
“That might be the real problem in the PHP land, every single dev or company seems to have built its very own framework while there are plenty available in an OSS fashion…”
If you have the capability to write your own framework, you absolutely should. Why rely on others to write code you can write yourself? That’s just lazy. Maintenance and scaling is far easier if your team knows the code 100% inside and out. As long as you hire good programmers, you’ll be better off going custom.
If you want to get away with hiring bad, inexperienced programmers, then, yeah, you should use a framework.
10.22.2010
cies
Python looks good, Ruby is plain hot.
I’d say Java is also quite nice compared to PHP.
It’s not about the language, it is about the skills of the programmer, but some programming languages just force one to write ugly code. I’d say PHP and Bash are –to me– languages like that.
10.22.2010
Dharmesh Shah
This is the first time I’ve heard someone say Java is cooler than PHP.
Sure, it’s really, really good at some back-end stuff, but none of the cool kids are starting with Java these days.
Having said that, we’re using Java and PHP at my startup (HubSpot). Every month or so, I’m tempted to shift from PHP to Python just so people don’t make fun of me.
10.22.2010
bosco
php is the best thing that ever happened,and i dont care what people say.As far as iam concerned everybody sticks to what he/she finds useful and easy to use,for me its php.
10.23.2010
Vassilis
Java?!
Please take that back, Java cannot be compared with PHP by any means.
It’s much more difficult to learn and use in my opinion.
10.22.2010
gregor
Really? How hard it is to learn has nothing to do with how well it runs. And it works perfectly well to build web apps. Please don’t try to belittle others when in fact you obviously have no clue what you’re talking about. A good programmer will use whatever language works best for what he needs to do, not “what is easy”. And Java has plenty of its uses.
10.22.2010
Josh
I couldn’t agree more.
We’ve had great success building projects based off of a programming team rather than a language that a programming team uses.
10.22.2010
Marcus Baker
Hi…
Ruby is sooo last year. Now it’s Clojure/F#/Scala/Erlang. Keep up people!
yours, Marcus (a PHP developer)
10.22.2010
Rob
Yeah, I love the way you throw out the sexiest new flavors and than state that you’re a php dev. How irreverent! I’ll sign off as (language agnostic developer *who_happens_to_be_using_ruby_now_but_has_to_get_rid_of_the_objective_c_long_names_i_learned_doing_an_iphone_application_over_a_year_ago)
10.22.2010
redwall_hp
Ruby and Python both interest me, but I hate their non-C style syntax. I want curly braces dammit, not BV-style “end” statements or whitespace to delimit methods. PHP could use a lot of work, but the style is just more logical.
09.02.2011
rtaycher
It depends. Probably mostly python and ruby although ruby has had a lot of backlash lately. If were talking enterprisy languages then java. If its a microsoft shop/microsoft centric programmer c#. If we’re kicking it old school lisp or smalltalk. If we’re talking about languages who are almost but not quite mainstream sexy scala and clojure.
10.22.2010
John
THANK YOU! I have heard the gripes so many times about how horrible PHP is and the snooty remarks about LAMP stacks and yet I consistently see PHP used phenomenally well in all kinds of applications… I once endured a meeting that included an entourage of ASP and MS Sequel Server guys and sales people. When asked what I planning to use (prior of course to this “meeting”) the terms PHP and MySQL came up and a hardy laugh followed at my expense. I was quickly told how IIS, ASP, and MSSql are the “big brother” of prior mentioned products. Six figure dev quotes later and deciding to go it on our own, we got what we needed in place for the 3 figure quote of $100… Needless to say, I’m pleased to see you OPENLY admitting to PHP… Go for it!
10.21.2010
Troy Tabor
How freakin funny! That is soooo true!
10.29.2010
Nathan Hazout
Yay for PHP!
10.21.2010
Rob Ray
word! PHP rocks!
10.21.2010
Mike
Not only is PHP cool, now there are some excellent Open Source frameworks such as Codeigniter and CakePHP, so PHP will be around for a lot longer yet.
10.21.2010
cies
With the framework it was shown that PHP is not so fast anymore. OO design (which was hacked into PHP later on) is not something PHP is good in.
These frameworks rely heavily on OO — so they’re slow. Before trying these framework make sure to try Rails, the web framework that inspired them. You probably have your project done faster with Rails, including the time you spend on learning Ruby.
10.22.2010
Boris Barroso
I love rails, check out my weblog. Rails is slower than CodeIgniter in terms of performance, but CakePHP is not so fast I haven’t tested against rails, sometimes I have to do work on PHP and I use CodeIgniter (Previously CakePHP) and I would prefer to do the Job with rails, you can do it so much faster even with a TDD/BDD approach in small projects. But the programming language is not as important as we developers think, generally customers don’t care if you used BASIC, as long as it does the job and is simple.
10.22.2010
Tim
“You probably have your project done faster with Rails, including the time you spend on learning Ruby.”
I had been using PHP for 5 years when I had to learn Rails. I hated it. A few weeks later, l I realized the above statement was completely true.
10.22.2010
Jeremy Dunck
There are many existence proofs that PHP can be used to make great things. Wikipedia, WordPress, Etsy, Flickr, etc, etc.
I’d argue that’s a function of its popularity rather than its utility. The fact that it has an amazingly low barrier to entry in terms of learning and deploying means the “sales funnel” works in PHP’s favor. More devs = more startups = more examples, and survivorship bias follows.
It doesn’t make it a great choice given other options, though. You’re invested, and be proud to have made a great thing with PHP. I think MailChimp is a great company, and the fact that you’ve managed to make PHP sing makes me more impressed with the engineering. But it doesn’t make me want to come work with PHP. :-)
10.21.2010
Cri
I think there are different situations where PHP fits like a glove, others Where ASP.NET, other RUBY, what i’m trying to say is that there is a purpose for every language, for me PHP is one of the most flexible programing languages ever and one of the hottest if not THE hottest.
Keep it with PHP !!!
MailChimp Rocks
10.21.2010
Hans wassink
I think it’s sweet you’re sticking up for PHP like this. PHP deserves it! It’s a very adult language nowadays and nowhere near the non-oop-resource-hog it once was. And you guys used it very well to your advantage. Mailchimp stays one of the best examples of application design for me and tbh, monkeys dressed in just PHP are pure sex imho!
10.22.2010
Alex
I like PHP. A good programmer can work with any language. PHP isn’t the reason for bad programming, bad programmers are the reason for that.
Regardless of what language you use, good programming is a skill that will not magically happen just because you use Ruby, Python, Javascript, etc.
Good post, PHP drives the majority of the web, its good for people to get a reminder of that from time to time.
10.22.2010
Ernie Miller
Perhaps good programming skills will not magically happen because of a language choice, but it’s also true that some languages foster better programming habits than other languages by making such habits easier to practice, while other languages discourage good habits by making them more painful up-front.
10.22.2010
Bill P. Godfrey
Is it good software thanks to PHP, or in spite of PHP?
10.22.2010
Iain Dooley
I was at a talk recently that had a comparison of languages to this new language (the one being talked about) that didn’t even list PHP :)
Whatevs mang. I’ve made plenty of good software and money using PHP. Anyone getting into this type of bullshit language comparison isn’t worth hiring in the first place.
In fact, anyone who says “Ewww” to any of the internal processes of a FUNCTIONAL and ECONOMICALLY VIABLE business doesn’t know what they’re talking about. Until you have learned the reasons for every technical decision ever made in that organisation, your opinion is worthless.
10.22.2010
Joe
I think you have the wrong idea about who the “programming elite” are. There is definitely a very loud minority of elite wannabes who tend to be young and very opinionated about their tools. Actual programmers care a lot more about the problem at hand than the color of the hammer.
The kids who spend hours every day reading and posting on HackerNews and Reddit aren’t actually the people you want to hire. You want to hire the people who get stuff done.
PHP gets a bad rap because it is extremely accessible. One of the things I have heard Rasmus say in one of his talks is that PHP runs bad code extremely well. He probably used slightly more colorful wording than that. And yes, there is a lot of bad code out there, and yes it works quite well. That doesn’t mean PHP can’t run good code as well. Companies like Yahoo, Flickr, Facebook, Etsy, Zynga and apparently MailChimp are all using PHP effectively to solve really large complicated problems. And if you ask them, I bet they will tell you that they spend most of their time solving those problems than worrying about their tools.
10.22.2010
konrad
“Companies like Yahoo, Flickr, Facebook, Etsy, Zynga and apparently MailChimp ”
Yes they can use PHP, but main question is how much do they spend on servers and maintance while using PHP and how much they can save if they switch to python or java?:)
07.21.2011
Roch
Well I don’t think they would save any money on servers if they move to python or java to be honest.
07.21.2011
konrad
Any objective reason why not? :)
Please check this http://shootout.alioth.debian.org/
PHP is much slower than python or java.
Slower language means CPU calculating more language operations not your application logic!
Someone said that facebook is using PHP, well this is true, but look how do they using it http://en.wikipedia.org/wiki/HipHop_for_PHP :D
Compare frameworks http://static.alrond.com/results_2test.gif
from
http://www.olympum.com/frameworks/rails-django-codeigniter-symfony-performance-compared/
It looks like django (writen in python) is much faster than competition?
Just check requests/second, Django 1000 vs 600 CodeIgniter.
If you are using CodeIgniter you need one more server to send responses for same number of users, now you can see savings?
07.21.2011
Roch
Hi,
You were talking about datacenters cost. PHP might be “slower” than Python or Java but as you said they are using HipHop PHP and some other technologies like Varnish servers for caching. I don’t really think they spend most of their hosting budget on PHP servers.
What the user get is mostly cached content, and this content is mostly generated by Mapreduce jobs, Logs analyzers or whatever. To be honest I don’t exactly know how their architecture works but I don’t think PHP is a problem for them. In fact if you are talking about Facebook I think they are more concerned about moving away of their MySQL Shards that are probably costing way more than staying with PHP.
Again I don’t work for any of those companies so I can’t tell you exaclty how much they spend on their PHP servers.
07.21.2011
konrad
I can see you don’t get main topic here, it is “Does PHP sucks or not?”:)
We should focus on language and frameworks comparisons not application server vs database server.
I don’t care how much facebook spend on application server. All i care is if you are using pure PHP or PHP frameworks you need more servers (or much more complicated development), to get same results, than if you were using for example python and django:)
Btw i wrote that facebook is using PHP, but this could be a lie, if they are using HIPHOP they are running away from PHP as far as they can.
Myth that facebook is running PHP is busted, they are running C++ in production:)
07.22.2011
Fred
Personal Home Pages (PHP) has evolved but what most ‘real’ programmers don’t like about PHP beyond it’s syntax is that there is really only one type (string).
Frameworks have been built to imitate all the things are baked into other languages. And even Facebook has shifted their own PHP to a C based derivative. Same syntax but compiled. It is not really PHP at that point. It is php-esque.
Another reason we hate PHP is that most PHP developers have no sense of architecture or capability in designing a suitable object set for an application. I have yet to see SOA with strongly designed RESTful web services done well in PHP. But then I don’t follow the language.
But the very best programmers won’t touch PHP. They play with languages like Go, Ruby, Python, Closure, Haskell. And its not so much the language that matters, its the way the language shapes your thoughts. It is the shape of the code that is more important.
That mailchimp has been successful with this shit language means you have smart people. Doesn’t mean PHP is good, it means you are good.
But you are right, I would never work there. I just wouldn’t know how to talk to you guys.
10.22.2010
Lazare Inepologlou
PHP does not have only one primitive type but actually eight: null, string, integer, float, boolean, array, ressource and object. The fact that the variables have a variant type (or “mixed” in php jargon) does not mean that they are all strings.
10.22.2010
Tim Dorr
Correct. This is know as a “Weak Type” language. That is, the type of a variable can automatically adapt to the situation it’s being used in. This can be a good or bad thing, depending on how you look at it and how you use it.
10.22.2010
Matthew Nelson
Tim, what you describe is dynamic typing. Weak typing is something quite different: The PHP runtime automatically typecasts when you use one type where another is expected. The PHP expressions “1”==1 and “a”.3 both include implicit typecasts, one to an integer and the other to a string. This is a frequent source of odd bugs in PHP code. For instance, “false”==false is false, but “false”==0 is true!
Many other scripting languages, including Python, Ruby, and Perl, are dynamically typed and strongly typed. The runtime will not silently typecast between strings and integers.
07.19.2011
Daniel
PHP stopped going by Personal Home Pages a long, long time ago. (PHP: Hypertext Preprocessor)
Facebook doesn’t convert their php into a c derivative or something php-esque, its converted directly to optimized c++.
Most web developers who are new to the scene use php, which is why the market is full of shit applications.
“And its not so much the language that matters, its the way the language shapes your thoughts. It is the shape of the code that is more important.”
If you’re letting the language shape YOUR thoughts, you’re doing it wrong.
“But you are right, I would never work there. I just wouldn’t know how to talk to you guys.”
They wouldn’t hire you anways, your attitude sucks.
10.22.2010
Fred
Daniel,
Come on, its a post on a blog. Is one post going to be reflective of my attitude? I disagree. Stop being such an ass. These kind of ad hominem attacks are unworthy of you.
I was probably less that clear. I think Mailchimp is pretty impressive that they could build such a system in PHP. It would have been easier in other languages. Any language really. I honestly believe that. And so do a great deal of other people.
There are points taken out of context (my own context being poorly formed). But this is one point I think needs a little defense: The idea that a language does not influence how one develops, designs and constructs an application is wrong. This is why it is encouraged to learn many languages. So we can see the limits of a specific mind set. It is why we are taught patterns (data structures, algorithms, heuristics) that facilitate and support our efforts. PHP does affect your judgement. Good programmers may be able to reflect these influences but at a cost.
I am certainly not saying PHP developers are all idiots. I know a few that are startlingly brilliant. And obviously Mailchimp is far ahead of the curve. But they’re outliers. Really. They are. They realized very early on that they needed to hire non-php programmers and make them program in PHP. That seems to justify my position that they don’t want PHP programmers.
Prove me wrong. I’m not arrogant. I can take a shot on my chin.
And you are right about one thing. I wouldn’t fit in with this model. Use a sub-par tool to do amazing things. It is possible. It is done. But I would rather play with the better tools of a better age.
10.23.2010
Chris
Doesn’t PHP stand for “PHP Hypertext Preprocessor”? I think the “Personal Home Pages” thing came around as a somewhat disparaging variation, implying that PHP is only suitable for hobbyist projects. Love it or hate it, that simply isn’t true. Personally, I feel that good programmers can write good code in any languages, language choice should be determined more by the task at hand, but also that some languages (like PHP) sort of encourage the development of horrible spaghetti code.
10.22.2010
Nerull
No, that is what PHP stood for when it created. And much of the dislike for PHP is rooted in that feeling that it IS hacks upon hacks upon a language that was only meant for little hobby projects.
10.22.2010
MrBester
You’re either a troll if you really think PHP stands for “Persinal Home Pages” or trying unsuccessully to make a superiority-complex based snobby joke. In any case whatever else you might have babbled about became utterly irrelevant.
No, I’m not a PHP developer.
10.22.2010
Ernie Miller
The poster is not a troll. Early in PHP’s life, that’s what the acronym stood for. See http://en.wikipedia.org/wiki/PHP#History. Much of that same history and heritage is responsible for why PHP is the way it is today, love it or hate it.
10.22.2010
atomking
“Another reason we hate PHP is that most PHP developers have no sense of architecture or capability in designing a suitable object set for an application.”
You can’t blame the language for the sins of bad programmers. Whether or not PHP itself has managed to attract to itself crappy programmers has no bearing at all on the utility of the language or its implementations. Also, is this the royal “we” or are you speaking for.. whom, now?
“But the very best programmers won’t touch PHP. They play with languages like Go, Ruby, Python, Closure, Haskell.”
By “the very best programmers” I think you actually mean “fickle people who flock to the latest thing” (mostly concerning the inclusion of Go, Closure and Haskell [especially]). Sure, I personally find it immensely fun to learn a new language and let that challenge me to solve problems in different ways. Just because PHP isn’t new and shiny doesn’t automatically invalidate it. This magpie attraction is the same sort of attitude the noSQL crowd has.
My biggest gripe with PHP is that there are faaaar too many standard methods that are synonyms for other methods.
10.22.2010
Keith Casey
“I have yet to see SOA with strongly designed RESTful web services done well in PHP. But then I don’t follow the language. ”
Well then thank you for your totally uninformed opinion. Do you have any others to share with us?
10.22.2010
Fred
Hi Keith,
Tons really. But its not really uninformed. Its a statement to the premise that I do not know all that PHP has done with RESTful services. Consider it my missing blue.
But you are right. It was presumptuous. I humbly bow to your call out.
10.23.2010
Peter
You can write atrocious code in any language, no matter how state-of-the-art, sexy, or fashionable it is.
10.25.2010
Hardik Ruparel
I picked up PHP thanks to the awesome documentation and community it provides. In contrast, the documentation for Python (which is really awesome!) isn’t all that great.
10.22.2010
stac
I love PHP, and I love Email marketing, and I loev your attitude,
but it’s shame that Atlantic sea separate us.
BTW: Here(Israel) .NET (yak) considered as Elite environment by enterprise’s.
Good luck hiring a PHP wizard.
10.22.2010
Nick Roper
Hey Guys – we’re Zend’s official PHP & Zend Framework training partner here in the UK, and of course we love and use MailChimp! Any Mailchimp users out there that are interested in our live online PHP, Zend Framework or (coming soon) MySQL & CSS training courses can get a discount be entering ‘chimp’ as a voucher code in our enquiry form.
eePHPeep!
10.22.2010
dougymak
I thought you were bashing on PHP. Good thing I read the full article. <3 PHP.
10.22.2010
Marcin Kowalski
Well, PHP has its annoyances, but as long as you are not trying to make it what it is not, i.e. apply some ruby-like design patterns, you just get the job done.
The PHP community is absolutely fantastic. Considering PHP’s great docs, ease of maintanance and very cheap hosting, I can hardly think about anything more pragmatic.
10.22.2010
I. Slavov
I’ve used ASP.Net (C#), Java, ASP and PHP. Nothing is as robust as PHP.
Of course you have to know what you’re doing when writing and (of course) securing a PHP website. While in .Net/Java these things are done for you, they’re done in the good PHP frameworks also :)
10.22.2010
kl
Proper application design is way more complicated than dealing a few PHP warts.
Good programmers can write good software in PHP. Bad programmers will shoot themselves in the foot using coolest language of the week.
10.22.2010
Andrei Savu
All the merit should go to the team not to the language for achieving this level of scalability and correctness.
PHP has many issues: low implementation consistency, huge global namespace, weak support for unicode, inconsistent way of handling errors etc.. You need a lot of experience to avoid all the pitfalls.
I understand that changing the language does not make sense from a business perspective and the same is true for facebook.
What I don’t understand is why are you insisting on using PHP as the only language touching the production servers at all levels? I’m a strong believer in using the best tool for the job (facebook does this a lot). Did you consider using something else for background data processing?
I believe you should focus on promoting the team and not the tools your are using. An awesome team working in a great environment matters more to me than the tools.
Why? Because a great team builds great software. After an interview, probably I would say yes to the team and no for the language. Make that yes weight a lot more for me!
10.22.2010
eRadical
You said that the team is important but you did not neglected to hit “a little” in PHP…
As long as the tool is good for the TEAM nobody has the right to argue otherwise…
Things in general will run better if anyone would drop “bad publicity” and start only “good publicity”. If you don’t like PHP advertise another language… just that… leave PHP alone… say “I don’t talk about PHP”
I don’t talk bad on Ruby & Python… I JUST DO MY WORK IN PHP… (and I’ve been doing that on business with 7 figures income… yes in PHP)
I also avoid to talk bad on other languages. (This does not imply that I do not try|use other languages.)
I just choose to not talk bad about those languages because… maybe… I did not got the language… maybe… it’s not the language fault.
10.22.2010
Andrei Savu
This is turning into some sort of holy war, that’s why this is my last comment here.
I’ve used PHP in the past, I’ve seen it’s good parts, I’ve seen it’s bad parts and I’ve shoot myself in the foot plenty of times. That’s why I’m saying that in order to be able to write good PHP you need a lot of experience (including experience using other languages and frameworks).
In the end it’s just a personal decision. I like Python and Java (and now learning Scala) more than I like PHP. I think that PHP it’s not the best tool for writing most the components used by MailChimp.
10.22.2010
eRadical
I’ve been using PHP for about 10 years now… and from MY experience there is nothing I cannot do in PHP… and yes I may and I do still shoot myself in the foot… But isn’t that the way to achievement (be it personal or professional)? [ I’m a Zend Certified Engineer, Sun Certified MySQL Associate, Certified Scrum Master…]
Of course in the end is a personal decision… that the reason this flame started in the first place…
What I do not understand is why you said:
I think that PHP it’s not the best tool for writing most the components used by MailChimp.
Who are you to say that? (No offence meant… just an invitation to introspection!)
How many successful applications did you launched?
How many millions of $ did you make that give you required knowledge to say that?
Do you think better than ALL persons at MailChimp?
Do you know ALL the things MailChimp has to do?
Do you have deep inner knowledge of their requirements, infrastructure…. etc.?
Everyone out there stop thinking that you know everything or better! Please!
You don’t!
I don’t!
MailChimp says it’s using PHP… I only want to hear more… how they did it? What were the major glitches? Etc. Please MailChimp… tell me more… share your experience!
If you will launch a successful application written in language X… I would ask you: how did you do it? What were the major glitches? Tell me about architecture (if it’s not a language I know)! Please share your experience!
Maybe I will start learning X!!!!!!!!
Sharing is better!!!!
Thinking you know better is NOT!!!!
10.22.2010
Jaime
I would never not take a job because of Php, but I surely would take a job over yours if it offers the same benefits but uses a better language. I think that’s the problem you’re having.
The reason Php is considered unsexy is because it’s slower than current Perl, Ruby and Python implementations, lots of modules aren’t thread safe, has terrible unicode support, last time I used it it still had awful recursion, has gazillions of libraries with crappy/weird abstractions, has awful naming conventions, lets not even talk about scoping, is in general less pretty than languages like Python or Ruby… and I could keep on going all day!
There’s a benefit to Php in that it has a lower barrier of entry and it easy to start building something fast for beginners. There’s also the benefit that it is widespread in comparison to more niche languages (though the community IMO despite large has a greater percentage of undesirables, this is personal opinion once again).
Don’t get me wrong I use Php sometimes (I have a knack for using Php on top of Java with Quercus for reasons out of my control), and I don’t really find I hate the language; however I do find myself wishing I was using another language when I do.
More important than the language though is that you guys at Mailchimp focused first on creating a viable platform for your development – which is a whole lot more important than what language you use – and that you’ve created your own framework to improve productivity and speed on your systems.
10.22.2010
koolhead17
fsck those oxymoron g33ks.
PHP rules and will always remain a favored language in web programming 4 n00b. :)
10.22.2010
Sten Morten Misund-Asphaug
I’ve been programming since I was 10 – in BASIC, C, C++, Pascal, Delphi, C#, Java, asm, PHP, Groovy, Ruby, Scheme, Lisp, JavaScript, VB, and probably a few other languages I forget about. Today, I am a professional programmer. In the last two years I’ve taken on both Java and PHP assignments.
It’s not about the language. A programmer needs to know several languages and not be tied to conventions and dogma. A one-language programmer needs to expand his horizon. He needs to be effective in capturing the requirements in any language. It is not about the language, but about the programmer.
Whether a language is “sexy” or not is purely in the eyes of the beholder. Someone going ewww seing PHP is immature as a programmer, and surely hasn’t questioned their own assumptions.
Good luck on finding great guys and gals for your programming efforts :)
Take care!
10.22.2010
Daniel Ow
Well, that’s hipster talk. PHP is my tool of choice and I simply love it. I’ve been with it since PHP 3 and it still keeps the love going.
What’s more frustrating is that some clients seem to have been brainwashed: “PHP? No, we have to use Ruby on Rails as it’s plug-and-play. I’ll be able to add any new functionality to the website without needing a developer” – this coming from someone whose greatest achievement in computing was using PowerPoint templates.
Well, can’t wait till that back-fires on this whole new ideology of using big, fancy words.
Cheers!
10.22.2010
Colocation
Developers love obscure and complex languages, it justifies their wage and like to think it provides job security (security through obscurity).
10.22.2010
Bill Barnhill
First off I agree with Sten on all his points. A good programmer can accomplish any task with any language if the task can be accomplished at all. That said, some languages are better than others at different things – each has their strengths and weaknesses. I’d say, as previously mentioned, that PHP’s strength lays in its low barrier to entry and the multitude of existing software.
It’s easy to build an application quickly but much more difficult to build an application quickly and properly. That gets to PHPs two biggest weaknesses in my mind: it’s designed for synchronous operations and it lacks many of the advances concepts from the functional programming world that make life easier like the 3 Cs (closures, continuations, currying). MailChimp is awesome, and clearly you modified version of PHP works to solve the problem. Could your particular problem be solved with less occasional bites by using another language. Don’t know that’s your call.
I’d suspect yes, by making using of async technologies with use of functional style programming For example a layer stack of Node.js, XMPP, Erlang, Riak or other NoSQL. But the tradeoff would be ramp up, rewriting the codebase, and re-inventing old features rather than re-coding new ones. Only you know what would work for you.
There are however still APL programs out there because they work, they have a large codebase, and switching to a newer language *for that project* incurs too much technical, operational, and/or financial risk.
10.22.2010
David Lohmeyer
Thank you for this article. PHP has excellent uses and no matter how “unsexy” the programming elite may think it is there are major players like Drupal, Facebook, and Mailchimp doing incredible things with PHP.
Not only that, but it doesn’t require an unfriendly amount of setup time for 99% of hosting available. Getting Ruby/Python actually setup to serve web content is plain annoying.
10.22.2010
Jaime
“Not only that, but it doesn’t require an unfriendly amount of setup time for 99% of hosting available. Getting Ruby/Python actually setup to serve web content is plain annoying.”
This is not true anymore in 2010. Want an example? http://heroku.com/
10.22.2010
Emil Endgut
after programming in a bunch of diff. languages for over 20 years, i have to admit that i prefer php to perl nowadays for certain types of problems.
i think the ability to judge comes with the years and not with the count of fired off 6-weeks-webapp-startup-thingies.
best
emil
10.22.2010
gprime
I use PHP 100% at work also and we run some of the largest sites in our industry on the web (millions and millions of hits a day). I believe in order for PHP to scale you have to design and code a custom framework which is what i do.
I have programming skills in PHP and C++ but some people at work just have PHP skills and they really do not have good all around programming skills. I mean they wont be able to write a program if they did not have all these easy to use built in array functions and stuff like PHP offers.
Anyways, i know a lot of bad PHP programmers….
10.22.2010
Mikushi
Agreed. That’s why i think it is part of our job (“good” programmers) to teach and show other programmers how to make a good use of PHP, tell them how it works, how it behaves.
PHP bad reputation is mostly legacy from PHP3/4 and from all the bad programmers that use it and make shitty code.
But as pointed by others, there is plenty of example of robust application built around PHP, Facebook, Zynga, Yahoo, and i’ve been dealing with high performance websites (around 20Millions visits/day, over 3Billions pages viewed per month) built around PHP, and i can say: PHP does well, the framework i used (designed/coded in house) compares to other setup i’ve seen made in .NET for example, while being more accessible and easier to use.
Long live PHP
10.22.2010
dude
I think you’ve got it a bit backwards. It’s not that I would think nothing interesting can be done with PHP (case in point: you guys, also facebook and a thousand others). That’s not it at all. You could do ‘interesting stuff’ with assembly, or Python, or server side javascript, or Rails or… Anything!
So, it’s not that. Not at all. If I’m applying to MailChimp then I know you’re doing cool stuff. The problem is that if I won’t take a full-time job where I write php all day. It’s infuriating. Sure, I can make some cool stuff happen. I can solve interesting problems using it… but I don’t want to! I can crawl to the mall, but, yea, no thanks. I can watch TV with commercials, but…. no. Etc. I also absolutely will not spend 8+ hours a day looking at php. It’s as simple as that.
10.22.2010
Andrei Savu
Totally agree with you!
10.22.2010
Jon Keating
If you don’t have any performance concerns, then using PHP is standard. If you want to make it sound sexy, have them use C/C++ to make PHP extensions… but then again PHP extensions aren’t very pretty on the inside.
10.22.2010
David Echols
A good programmer can use any tools to accomplish his job. But that doesn’t mean there aren’t better tools or better languages.
I have to disagree with your thoughts about PHP, or rather, any dynamic, weakly typed language. These languages leave much to be desired — they usually don’t have compilers, which means that Quality Assurance is left to write automated tests that eventually cover the situations a compiler would check.
That’s a ton of work for no good reason.
Customer’s data is sacred. Killing your type safety is an excellent way of making sure you blow someone’s data up. The *least* I can do is making sure a customer’s data is hitting a database as a specific type. It’s not the only step you need to take (far from it), but it’s a first critical question — “Are we giving the right bucket to the database?” — is essentially what the compiler can check for you.
PHP has its own history of interesting design choices, (which I won’t get into here…) but the most painful one is the lack of any kind of strong typing whatsoever.
10.22.2010
Jack Slingerland
I’ve been using PHP since early version 4. Yes, PHP has some warts, but it’s also so flexible that you can do nearly anything with it. For instance, I’ve been writing a series of the “Dark Arts” of PHP (multi-processing, shared memory, IPC, gui programming, etc) just to show people that it’s not all about web development.
Anyways, keep up the good work guys. You’re service is an inspiration to us all.
10.22.2010
Will Castillo
What? PHP isn’t cool? Chad, you broke my heart! :)
I can’t agree more with @Joe.
It reminds me of those people, back in the nineties and well into the 2K, saying that Visual Basic s*cks. I’m talking about the ol’ v6 not the “cool” .net version.
Some people just follow trends and they keep learning every piece of tool they read about in Slashdot but ultimately failing in mastering any of those.
Damn,,, I remember doing cool things even in Logo and GW Basic! :) The power of a program it’s not just in its capabilities but in the hands of those who use it.
Anyway, yeah, we can miss some aspects in PHP, but the beauty of these days is that you can always create small, stables and reliable interfaces between almost any two systems to make the day. I bet you have some of these interfaces running here and there. That’s what makes a good program into a great application: Taking the best of… any world.
10.22.2010
Charles
What is ColdFusion?
10.22.2010
Will Castillo
Wow… Given the time you posted this article and the amount -and passion- of the answers… i think you should post nerdy stuff like this more often :)
10.22.2010
Mo Kakwan
All of Blabberize.com runs on PHP and it does some pretty ridiculous things.
I think there should be a post about “What I don’t like about PHP from someone who loves PHP”. There are lots of features of the language we had to build our framework to help us work with/around which sounds a lot like your framework does as well.
10.22.2010
Edgar Friendly
I think it’s pretty obvious that, if Facebook and Yahoo can use PHP to such great effect, so can you.
On the other hand, I’m certainly not looking for a PHP gig :P
10.22.2010
Ray Krueger
Why should anyone believe that your PHP framework is so awesome? Why not back up that talk by open sourcing it and showing the world how awesome it is. Then maybe the folks that say “Ewww” would change their tune.
10.22.2010
Mal
If you were in another country, then PHP would be a lot more accepted. The US is bit unusual because Python is very popular too, so developers are more diverse.
In the end though, it doesn’t really matter what language you use. If people turn up their noses at the prospect of using your choice of language, then they are obviously not worth employing.
10.22.2010
brad c
a willingness to put up with poor tools is not the hallmark of a strong developer, it is the hallmark of a desperate developer
10.22.2010
Ernie Miller
I guess my main gripe with all of the effort that goes around these types of frameworks and optimizations built on PHP (I boggled that Facebook spent time developing HipHop, for instance) is that they’re strapping a rocket engine to a tricycle.
The language itself is so fundamentally goofy and cumbersome that most frameworks burn a lot of effort trying to make PHP feel less like PHP. Why bother, then? If the language is this flawed, start from a better base.
I can understand the argument that PHP programmers are plentiful and cheap. You’re saying that you’re seeking quality over quantity, as I’m sure Facebook is, too. So I guess I’m just not seeing the logic here.
10.22.2010
Logan Lindquist
php is awesome. don’t listen to the ruby snobs.
10.22.2010
Frank Stallone
I think the problem with PHP (for some people including myself) is that is such an ugly inconsistent language.
Now I know going back now and converting all methods to an under_score_format or camelCase would cause problems but I believe it would help a lot. Namespaces are also a bit ugly.
PHP is nice and all that. After all I still use it but I do think once people sit down and learn something cleaner like Python or even Perl then PHP just starts feeling a bit annoying.
It is useful and has enabled a lot of people to get into web development because it is easy but it does feel a bit amateurish. Combine that with its performance in the wrong hands (which seems to be a lot of hands) and the language’s age and it’s no surprise people turn their nose up to it.
10.22.2010
kilinkis
this is the first time i read PHP is bad. I love it
10.22.2010
gsvolt
My belief is that you should use the language that fits the bill the best.
I am agnostic. I give all languages consideration before start of a project, sometimes clients choose their language of choice, sometimes I do.
10.22.2010
MaryAnn
Just thought to point out you are missing a ‘t’ in ‘thought’ in the sub heading ‘I thought you were cool’
10.22.2010
Siddharth Goyal
To be honest this is the first time I am hearing that PHP is considered bad. Considering the world’s most popular CMS wordpress is PHP based, I see no reason why people should say such things.
I guess if something is super easy to learn and implement, it ipso facto, becomes “down market” :P.
10.22.2010
Theodore R. Smith
I’m going to give up reddit because of all the PHP bashing.
I personally love programming in PHP and have been doing so for 12 years now.
I challenge someone to come up w/ a competition, something fancy, complicated, with detailed specs. I want to personally go head to head with professional ASP.NET, Java and Ruby developers and see who comes out first.
The only qualification: NO FRAMEWORKS.
We should code from scratch.
No use giving frameworks like Rails an edge, this will be on core programming.
Then, we will take away points to people based upon how expensive it would be for a medium-sized business of, say, 50 employees to adopt.
Come on! Accept my challenge or shut the frack up!
10.22.2010
Peter Hamilton
Dropping frameworks isn’t quite fair. If you want to drop frameworks, then the PHP crowd should drop mod_php. It itself is essentially a framework. Instead of a MVC model, it uses the directory structure.
If you get rid of frameworks like rails/sinatra/django/etc. You are basically saying: Let’s see which tool is best for attaching two pieces of wood. The contestants will be a hammer, a screwdriver, and wood glue. BTW, no screws or nails allowed.
10.22.2010
Adam Nelson
@Theodore It really is unprofessional to suggest somebody write a site without a framework these days. CakePHP, Zend, Symfony, are all valid choices for PHP. Running without the framework is not maintainable and it shouldn’t be recommended to anybody.
Even Perl has a web framework now -as do Scala, Python, Ruby, and even JS.
10.22.2010
Eric
Ya, it’s always a great idea to code from scratch and handle all the security, performance, CRUD yourself because we all know how well that works.
:/
10.22.2010
Theodore R. Smith
To all: If someone bashes a PHP framework, say symfony, then I’m all for them doing the competition w/, say, Symfony vs Ruby on Rails.
if someone bashes PHP, then they have to strip down to their base language as well. I don’t want to hear excuses like, “Well, PHP has so many more wonderful built in functions, it wouldn’t be fair!” because by and large, those same people bash PHP for having so many built-in functions.
10.22.2010
mozey
Developers who playa hate on php should GROW THE F UP!. Mind you, when i do web development, i would prefer to do it in python, BUT, i would NEVER shy away from php. And i disagree with you when you said that a good php developer is an oxymoron. You will never see a good java programmer who will automatically suck the moment you ask him to do something in PHP. One could be a little unseasoned in the language but such as any technology. Look at what it had produced, Youtube, Facebook, wordpress, drupal, this and that. Its an effective language, and if you cant handle the dollar signs and the curly brackets!, then you should get into marketing!. gosh that irritates me.
10.22.2010
Nolan Grupe
Great to hear! I’ve been a hardcore php developer for awhile now, and I’m still amazed at how quickly projects come together. I think it’s both an advantage and disadvantage that programs can be written so quickly: leads to lots of php hacks, but also a quick turnaround on projects. The only headache is having to revise an uncommented php codebase that runs hundreds of files.. Unless it’s CodeIgniter at least!
10.22.2010
elvy
PHP gets the job done.
Congratulations on getting the job done and having a successful business.
10.22.2010
Alex
Oh no, not this sh** again. If some snobby wannabe geek want to tell you PHP is such a lacking programming language, RUN, don’t walk, away as fast as you can and leave them alone with their ROR, Smalltalk or whatever. Wikipedia, Facebook, WordPress among countless other examples all done in PHP. This is the real world, not some idealistic nerd playground.
10.22.2010
aleks
If you are worried about elegance and aesthetics, PHP is definitely not your first choice. Nevertheless there is a lot of great PHP code out there and in the recent past, the language itself is constantly extended with exactly the features that are needed to make it more ‘professional’, clean and competitive.
Nearly all leading open source web applications are built in PHP and that’s not just because PHP is most supported but also because the solutions built with PHP are simply superior regarding their functionality.
Also look at upcoming projects like the Lithium framework that come across really really slick. PHP definitely doesn’t have to look like hell, it just often does because the entry level is so low.
One of the main things I am jealous of when I look at other languages like Ruby is that there are a lot of ‘libraries’ out there for different kind of tasks that can be used and plugged in using any framework/any environment while most of the quality PHP code lives within and heavily relies on certain frameworks. That’s something that I hope will change in the near future. (The new version of Symfony is already a good indicator.)
But I guess I am writing too much and sound like a fanboy while I have really got a lot of love for Ruby, Python and many other ‘new’ languages. My main point is probably just that PHP does not automatically equal messy trash code and that I want to second one of the points in the article, being that in the end, it comes down to how the individual developer solves problems and languages are merely ‘tools’ we work with to get things done. And depending on the respective task and environment and the availability of information and work of others, you’ll find it easier with this or that language.
10.22.2010
brad c
i’ve developed in php for years at high volume web sites, and i don’t see how anyone can defend it. it is a terrible tool filled with unforgivable bugs and inconsistencies. i truly believe that its defenders simply have never been exposed to a properly designed tool
the api is inconsistently spec’d
pear is a ghetto. perl has 1/5 the active developers yet cpan is five times the size of pear
php is worthless outside the web realm…with perl or python or ruby, you can use the same language to write automation scripts. its possible to script with php, just like its possible to eat at the french laundry with a spork
php is slow, which is funny considering the language is uninteresting and provides few modern features. php5.3 really only brings it up to par with what perl programmers had available in 1996
10.22.2010
Mal
I don’t think most people treat Pear seriously, to me it’s a place to get ideas when I am struggling with something; I have never used the code directly.
Just stick with the extras provided in your chosen framework or build your own.
10.24.2010
Svend Tofte
I’ve always loved Javascript since the late nineties, when I first started programming, and with the years, I came to love it even more. I learned about the functional aspects of JS, back at a time when it was widely hailed as one of the biggest mistakes in the web application stack. But I always felt that the language core (if not enviroment) was beuatiful. 10 years ago I was doing highly functional JS DHTML, reminescent of current day jQuery like code.
PHP has faults, and not optimal for everything, but it’s perfectly workable. It’s not like you’re using Prolog for everything, or XSLT (both of which are Turing complete, and in Prolog, it’s not alot more horrible then doing advanced stuff in XSLT).
10.22.2010
Alexis Sotir
There so much open source code available in PHP and as Chad says it, it fuels the innovation. We code open-source and we wouldn’t change our mind about it. And most of the coolest things (or even most successful ones) I have seen out there are in PHP. Whoever bashes PHP needs to grow up. ;) It gets the job done.
10.22.2010
Chase Sechrist
I agree completely with the statement that the platform is much more important.
PHP as a language is pretty messed up, but so is the current implementation of ecmascript, and rails, and django, and everything else. Sure, PHP’s typing is a little more screwed than some others with the zval nonsense, but it’s still improving. 5.3 introduced the reference GC, which enabled me to build full on, never terminating, applications in a simple language. PHP’s string manipulation and basic web-oriented standard library is still simpler than other systems for random one off edgecases, especially when you realize that PHP doesn’t have many surprises. If you need to cache, you set up APC, increase your FCGI handlers, and start to talk to memcached or redis. Load balancing PHP isn’t any different than any other web applet system. So when people talk trash about scaling PHP, it’s all in the implementation.
10.22.2010
Chris
It seems like the people who down PHP come from the server side world: Java or C++ developers. And for most I’ve encountered the issue is with web development technologies in general (sorry Python gets roped in too). They’re too simplistic, too divergent from established practice, and have too few robust toolsets to aid development. What they fail to realize is that web development is a rapid release business, and heavy technologies aren’t suited for it.
On the whole, I’m always impressed that PHP developers tend to focus more on the final product. And if you look at companies that started on the web–Amazon, eBay, Facebook–their primary codebase is either PHP or Perl. Not bad company.
10.22.2010
John S.
The tone of this post is more than a little defensive. You use PHP for your application, so what? Yeah, there are better languages out there. However, your company is making money and growing rapidly. That simple fact and that mail chimp is solving interesting problems are far more salient features of the company. Really, you have nothing to be ashamed of.
10.22.2010
Karl G
I’m one of the PHP haters. I think it’s the ugliest mainstream language and have argued against using it for years. When I get overridden, it’s always because “it’s easier to find php developers” than X developers for whatever X I choose. For years I’ve argued that the issue isn’t finding developers but finding GOOD developers, so I read the opening feeling quite vindicated.
That said, I’d love to read about or take a look at your system. Facebook aside, every time I’ve had someone point out some neat PHP project I always wind up disappointed. Do you have any technical presentations online?
My primary gripes with the language are its crime-against humanity syntax decisions, bag-of-functions library design and its tendency to be the first piece that fails in a multi-language system. In a platform, the library design tends to be papered over and it sounds like you have the scaling issues in hand. If you tossed in a coffeescript-like source code transformer, you’d get no complaints from me.
10.22.2010
mark
I don’t think that anyone has argued that PHP can’t be used to create massive scale projects (LAMP stacks are incredibly popular). I think your assumption of what people think is just off-base.
PHP is a great prototyping language as well.
Personally, I would rather not code in PHP due to my liking other languages much better. I recognize PHP can get the job done and have coded in PHP for several years in the past. It is just better for my career to look forward to modern languages.
10.22.2010
Ben S.
Once you get to the scale of computing we’re at, the language you use is much less important than the platform you build on it. A simple language change isn’t going to make these problems less complicated, or less awesome.
Well stated. Keep up the great work.
10.22.2010
Andrew Velis
I am not a fan of PHP and yes I am going to comment on this post. But rather then just bash on it I wanted to give some food for thought. No programming language is perfect. In fact depending on what problem you want to solve some languages are worse to use than others. One of my biggest gripes with PHP is that it is very easy to fall into bad habits and bad code practices if you really aren’t careful with what your doing. Personally I would not suggest PHP for a starting programmer. However if you have a great grasp of the overall philosophy of the language and know not to fall into the pitfalls that PHP has (as well as with any other programming language) then truck on and keep on innovating.
10.22.2010
John Haugeland
Almost none of the real programmers I know react poorly to PHP.
10.22.2010
Brian Reich
I only got through a handful of the comments here before I gave up. You know what the sad part is? That MailChimp feels as though it needs to apologize for choosing PHP. As others have pointed out PHP has more than proven itself in terms of popularity and the number of wildly successful projects written in it.
10.22.2010
Joshua Estes
I think it’s funny that all the Rails developers talk smack about PHP and how it doesn’t do this or that, but they are comparing a framework to a language. I love reading blogs where it opens with, “I’ve used Ruby to 2-weeks..” and now they seem to be an expert?
When you match up some of the more popular PHP frameworks, such as symfony, with Rails, then it all comes down to a matter of the programmers skills. It’s not the language that makes an app good/bad but the programmer(s) writing the code. Any decent programmer realizes that fact.
10.22.2010
Prasenjeet Pati
Been in the IT world for 20 years and have closely observed and analyzed the attitude with people in the field.
Most youngsters are not bothered about IT at all, they are in it coz that pays well. Apart from “pay package”, they have no clue or plans. Their “guru” is their college senior or “elder brother of his friend”, who in turn is no better.
People working in a particular technology tend to demean others since they want to feel “superior”. Most often, they don’t really know the difference. They never try or intend to find out.
Sadly, technology is not about “syntax”. Its about the domain. As the author of this post rightly said, its not what one uses but what he produces that matters.
Its very rare to find a good programmer (I am not talking about a “coder” here). Just because PHP “appears” to be something simple (read, “not cryptic”), its treated as “easy” and “unworthy” of the greatly hyped Java or heavily marketed .NET.
To me, a programmer thats strong and good with one language is going to be as great with another, once he gets just a couple of weeks to become familiar with a new platform.
Cheers
Pati
10.22.2010
Jay
Ouch, I’ve been working with PHP since I was 10. I don’t see how it could have gotten such a bad repetition. If you know what you’re doing you can produce very, very efficient code using the best and greatest practices any other developer uses and also spend less time developing since it’s so powerful.
10.22.2010
Josiah Platt
PHP wins life. :D
ME <3 PHP at http://magnt.com – and where would the world be without WordPress??
10.22.2010
Jermaine Maree
Wanted to give the PHP devs out there a new framework to check out – PHP Fat-Free Framework – http://fatfree.sourceforge.net
It does not have all the bells and whistles of say a CodeIgniter or CakePHP but I’ve built some really nice things using it. In addition, it has built-in support for MongoDB.
10.22.2010
John Wright
I know Ruby and RoR are the cool new languages/frameworks. And even from a design perspective Ruby is much more elegant a language. But the benefit of PHP is that it works, it’s been tested in many environments and is used all over the place. Almost all hosting providers support it. It is tried and true, and it was developed from the beginning for the purpose of manipulating strings to output HTML. It’s built specifically for the web.
So look at it as uncool, but I think they’ve been mislead. If you know PHP, don’t hesitate to use it, if it is the right tool to use for the job. If you don’t know PHP you might want to learn it.
I’ve learned some Ruby and RoR, and I look forward to doing a project in it, but one concern is possibly not enough choice (competition) in hosting environments.
I do like Ruby a lot and it is very cool, but PHP has a lot going for it (it’s established, it’s everywhere and it works) and shouldn’t be overlooked.
Like you mentioned, Facebook is built on top of it. That says a lot for it considering how huge Facebook has grown.
10.22.2010
Jonathan
Having worked with Zend, Codigniter and Rails for 5 years I can honestly say that Rails is much easier and more enjoyable to work with. I’m always really disappointed when someone asks me to use PHP over Rails because I know it will take me longer and have me banging my head because the language is so clunky. Also, I use HAML & SASS which makes front end coding a delight.
10.22.2010
Anonymous
I actually find this pretty offensive. I live in Atlanta, use PHP and I consider myself a great developer. Of course I code in other languages as well. But to say Atlanta is full of “dumb” developers? There is no reason to stereotype.
10.22.2010
Michael Pelz-Sherman
PHP has many well-known shortcomings as compared with other OO languages, Java in particular.
Among the main ones:
– no support for namespaces (until only recently)
– no built-in automatic class loading (until only recently)
– loose typing forces developers to write unit tests to catch stupid errors a compiler would catch
– no threading support
– poor exception handling control (e.g. cannot declare whether a function throws an exception)
– lack of constructor chaining
– lack of native multi-byte support
– lack of solid ORM frameworks like Hibernate and EJB 3 makes it difficult to handle database I/O cleanly (and yes, I’ve used Doctrine…)
In my opinion, PHP (like Perl and other scripting languages) is great for small, isolated scripts or simple web sites. That is what it was originally designed for. For very complex applications, however, Java and its ilk are simply better. That’s why most companies looking to hire good OO programmers generally look for Java or C# developers who are willing to work with PHP.
Having said all that, I fully recognize that PHP is very popular for web startups, in part I think due to its ubiquity and the seductive ease of getting started with it. It was probably a great choice for MailChimp back when y’all were getting started, and it’s nearly impossible to change languages once you have a ton of legacy code that’s supporting your business. All web software requires good architecture to scale well, regardless of the language it’s written in. With some clever engineering and add-ons like APC, memcache, etc., PHP can be made to scale very well. So like Facebook, you guys are probably stuck with it indefinitely, for better and worse. The good news is that companies like Facebook and MailChimp are putting pressure on the PHP development community to improve the language and provide things like APC and HipHop to address its shortcomings. It will be interesting to see how the platform evolves in the coming years.
10.22.2010
irv
I don’t use PHP anymore (Rails convert) but it served me well for years. It’s a fine language.
More importantly, compared to horrors like JSP or .NET it’s downright wonderful!
10.22.2010
Adrien
I built an ERP in PHP in 2003, still in production, no maintenance ever.
I built a Data Warehouse backed Real Time Web Analytics in PHP.
I built all my cloud infrastructure management scripts and tools in PHP.
The only thing you need is a IDE with auto-completion for the arguments order. Once you have this, PHP is my language of choice.
10.22.2010
Sam
Are you guys serious? How incompetent are the programmers at mailchimp? Agreeing to the fact that you sadly built this in PHP?
If you hate PHP so much, why didn’t you do BASIC project planning and choose a language of choice before starting this?
Sickening. This is why we shouldn’t hire ill-educated programmers for large scale projects.
10.22.2010
Terry
+1 for Atlanta PHP love!
I’ve been coding for 30 years, and have heard the same crap over and over, just the language names change.
For all of you young programmers (and a lot of the old ones, too), here’s a bit of advice that will serve you well in your career: A programming language, above all else, is used to clearly and concisely communicate a structured process between people. The fact you are executing on a computer is secondary.
PHP is a very good language in this regard. Yes, it has rampant namespace pollution (which can be fixed) and seemingly random function names (which can also be fixed), but it does a good job of conveying intent to other people AND to computers.
Lots of people sing the praises of object-oriented everything these days, but people do not abstract concepts as rigid, structured objects. Even if they did, no two people would come up with the same structure, so you end up with inheritance hairballs if they try to co-exist, or more likely a different object definition per person if they don’t play well together. These same flaws were made obvious years ago in relational databases, but computing has a bad habit of making the same mistakes over and over, and only the scale changes.
Indentation-sensitive languages came and went, and now they are back again. They will probably go away again, too :-)
If you’re a good programmer, you can write good PHP. If you aren’t, you can’t write good Python, Ruby, Scala, Go, Java, etc. either.
10.22.2010
Max
using PHP is not a bad thing and no i am not a php developer, but rather .Net Developer. PHP has some good features in it.
10.22.2010
Pedro
Unless your developing an app for developers (most probably not), who cares if the used language is cool or not? Your users have lots of other things to think of. And even if performance is an issue, there are lots of other things to consider before switching to another language. PHP is cool enough for most applications. It not about what tools you use, it’s what you do with them, and most of the times, how you use them.
10.22.2010
Markus
The part about Facebook is misleading.
Facebook actually said they wanted to stop using PHP, but were too heavily invested in it, code wise. Sounds like you at Mailchimp has coded yourselves into the same corner.
Yes, PHP is adequate. That’s about it.
If you’re maintaining a legacy codebase and you have no choice, use PHP. If you’re starting a new project with competent developers, you’d be foolish to choose PHP. People think it’s awful for good reasons.
10.22.2010
Leo
so…. it scales (but takes a lot of work to accomplish that)…
that doesn’t make it even remotely close to a good language.
10.22.2010
meeerk
Actually the ‘programming elite’ don’t really have a problem with PHP, I think that’s more an opinion relegated to neckbeardy rails hipsters.
10.22.2010
Michael Buckley
Provided the problem is interesting, I will happily sit down and mash it out in any of the programming languages I know, PHP included.
However it must be obvious that all languages can’t be equal. Some are clearly better designed then others, some are faster, more productive, lead to better architectures, etc. And some languages just have more warts then others, and PHP has quite a few of those.
But heck, at the end of the day all of that might be besides the point. The last large project I worked on the choice of language was biased on which of the “web languages” I know had native unicode support, as the projects main purpose was processing large amounts of non English/unicode text. PHP did not and Python did – though I knew PHP better.
But one of the most stupid things you can do is rewrite an existing project into another language (if it is non trivial), the chances of killing it are quite high and what you gain is quite low.
It is also a good idea to standardise on a single, or at least a set of languages. Which appears to be what MailChimp has done, which might be helping their success, even if it is not the language I would use (or even they would use) when starting a fresh project.
10.22.2010
Saurabh Srivastava
While the discussion has taken a totally different direction of comparing technologies and defending choices, I think thats not the reason for the Ewww.. phenomenon.
If you were to hire a person who has been an entrepreneur or aspires to be one, the outlook would be different. But if its a regular developer being hired, they would have to think about the value that they would like to add to their resumes which would make large high paying corporations value them.
Unfortunately, not many large company CIOs like languages like PHP :)
10.23.2010
Nick Roper
@Terry
Agree 100% – well said sir!
Nick
10.23.2010
Ray Paseur
Facebook written in PHP? WTF? Why wasn’t I informed? I’m going to stop using it right away, because of that stupid PHP language.
Fortran. There’s a manly language!
10.23.2010
Vuppa
I started out with PHP back in the days when it had lousy error handling and no OO. But I was very happy with the Quick’n Dirty style of programming – and I was very productive. I’m not into PHP anymore but judging from the number of attacks on my java webservers every day from PHP servers that have been hacked I assume Quick’n Dirty is still the preferred style in the world of PHP. But java and scala don’t have the charms of Quick’n Dirty – I sometimes miss that.
10.23.2010
MSang
PHP is AWESOME!
10.23.2010
Leo
Why do most people that embraced themselves and moved to another language never wanted to look back at PHP and can list a fairly large amount of mistakes about it?
Yes, what Terry says is of course correct, people uses PHP (mostly at first) because of that special quality it has (read Terry’s comment), but it seems to me, that when analized in reality, PHP is to other languages what tons of crappy JavaScript code that we still see around the web is to good JavaScript code: People choose it because they don’t know any better, or they do but they didn’t embrace themselves into *really* move to another language [better JavaScript code].
And Facebook doesn’t just use PHP, quit quoting it. You think they have servers running PHP interpreters for all the amount of black magic they needed to invent to keep it going? Please, there’s Python, Java and C++ involved afaik.
10.23.2010
Gavan Brown
PHP isn’t BAD, it’s just becoming archaic. I’m sure if you had 1000 years to spend, you could even develop your system using Assembler. If it worked for you, great! But its silly not to try to a more modern framework for future projects.
10.23.2010
Jeff
Being successful in the technology sector is often contingent upon your willingness to work with a variety of technologies and environments, some of which are going to be uncomfortable, unfamiliar, and at times, unpleasant. If you shy away from this, or worse, incessantly complain, you’re going to miss out on the experience, knowledge, and culture that different technologies offer and you’ll quickly find yourself out-classed by your peers.
As someone who hires developers, I can tell you that I’m always looking for people with diverse backgrounds that can tackle problems across a number of domains. Never have I found a developer like this who complains about working with technologies which are integral to our operation.
The bottom line is this: Good developers are going to excel at any technology without issue. Bad developers are going to fuss and complain and do whatever it takes to stay in their comfort zone.
10.23.2010
Stew.Pidbeatch
PHP isn’t bad. It’s just that too many bad people write PHP.
10.23.2010
Will
We use php for a lot of our sites, i disagree with people who think php is not as “challenging” as some of the other languages such as javascript. Developers need to get over themselves and use the appropriate language for the application/site they are building. Its not a competition! (sorry i get quite worked up about it.)
10.24.2010
surtyaar
I agree with you that PHP has proven itself as a scalable and stable language. But the motivations behind choosing a right technology are more complex than just deciding what scales the best.
I’m curious why you guys chose to go with PHP over some of the alternatives.
10.24.2010
Ben MailChimp
I’m not the technical guy here, but I can interject a little historical perspective – MailChimp launched in 2001. IIRC, our choices back then were PHP, Perl, ASP (.Net was kinda new), Python (which was also pretty new at the time, I think) and Coldfusion (which I think was on the decline). Two big factors for us back then were: 1) documentation, which PHP had a lot of, and 2) hosting providers that actually supported Linux *and* gave root access to stuff. Ah, those were the days.
10.24.2010
Reid
In my experience, the people that hate on PHP tend to talk about what “real programmers” think about it…and at the end of their argument I’m left thinking – here’s a guy that knows a “real programmer” who doesn’t like PHP and told him how much it sucked…and this guy’s now blogging about it as if it’s true. Rarely do they point to anything quantifiable or even tangible to back up their rant.
I have a background in Comp Sci and thereafter worked for six or so years as a C/C++, Java, C#, and Perl developer before finally messing around with PHP. Now four years later I’d say that PHP is second only to Perl as my favorite language to work with on a daily basis. Anyone who’s spent real time with Java or the like would at least have to agree that Java and it’s cousins are incredibly bulky and syntactically verbose compared to PHP. For me that boils down to more overhead, slower roll-outs, and just plain less fun. And like 90% (100%?) of the web developers I know, fun is what it’s all about.
What people most often claim is the “problem” with PHP is in fact not the language, it’s PHP’s low barrier to entry, the very mild learning curve, that leads to so much junk code. And it’s rampant, I would never argue that. But Perl is just as prone as PHP to this kind of hacking (perhaps more so)…I don’t know too many “real developers” that would claim that Perl is junk.
Haters also like to bash PHP because there are too many frameworks available for it. They moan and groan about how this leads to disparate code on the ‘Net, how much that sucks, and as a result how much PHP sucks. I just sort of laugh.
I feel kind of silly defending PHP. All languages have their shortfalls and I’m certainly not claiming that PHP is any different in that regard. And I wouldn’t use PHP for every project. But for many large and modern websites PHP really is an ideal candidate for the back end. I mean, if it works for you guys right? Oh and speaking of, if I were one of your employees who’s worked to build this super-awesome-best-ever PHP back end you have going, I wouldn’t take to kindly to your claim that “The term ‘good PHP programmer’ is considered an oxymoron”. By who? You? Or by “real developers”? Not this one anyway. But I digress.
On a completely different front, you clearly believe your hand-rolled PHP framework as completely freaking awesome. I’d love to see some benchmarks against some of the modern open source frameworks like Symphony, Yii, etc. I bet you would too! Perhaps a follow-up blog post…
I guess my point here is, no matter what language you go with you’re going to find examples of crappy code written by people that don’t know what they’re doing that’s poorly doc’d and full of bugs. With languages like PHP which make it easier for the average Joe to get under the hood, these problems are going to be more commonplace. But that does not mean that developers can’t leverage PHP to write clean, efficient, OO, doc’d code which results in a stable and scalable platform on which to base a powerful, modern website. It seems to me like MailChimp is a prime example of this. I hope your blog post and your awesome website serves to school some of these “programming elite” on PHP and what it’s capable of.
This was supposed to be a one-paragraph post, hmm, I guess I had more to say on the topic than I thought. Oh well. Anyway, last thought? MailChimp rocks, keep up the good work.
10.24.2010
Alexander Williamson
I’ve used PHP for many years, it’s well written, has a good code base and lots of extensions. The extensions (e.g. PEAR) got a bit fragmented at one point, but that happens with all languages.
The only point I really have to make is that it’s a good language and compares well to the rest of the languages offered on the market and gives similar results.
You’re always going to have negatives and positives about all languages, nothing is perfect (of course we’re trying to work towards perfection).
If PHP does what is required of it, its easy for your new developers to get acquainted with, is fast enough,scales and is futureproof, then I see no way in showing it to be a bad choice for building the systems with.
I think your decision was a good one. If I wasn’t in the .NET language now, I’d either be in Phython, Java (fragmented) or PHP (preferred just because it’s so quick to build something).
… and as you said, Facebook is built on PHP…
10.25.2010
Maleko
We use it too. So how about some tools for me to get my php site to input data into your php site?
10.25.2010
Christian
That you can write good software in PHP has nothing to with the language itself, which is pretty ugly. There is absolutely nothing cool on PHP!
Take a look at Python or Scala, they are both fine languages and much better than PHP.
10.25.2010
Martin Bean
There’s nothing wrong with PHP. Those who talk down PHP are usually those who have never programmed in it.
PHP is capable of all the stuff the “big boys” are capable of, such as ASP.Net and whatnot. And while it may not be as lightweight as Ruby on Rails (the latter of which is a framework and not a language, so the comparison is moot) good stuff can be accomplished with PHP.
10.25.2010
Chris Robinson
Seriously folks. Do you hear yourselves? You’re actually discussing the “cool factor” of programming languages. Your programmers, stop whining and make it happen in the best way possible. Want a web programming job? Then learn how to write ugly PHP because it’s not going anywhere soon and you WILL need to use it at some point. And yes, if you don’t spend some time with it you’ll end up writing the same crap code that most of these misinformed folks are complaining about. It’s very easy to be lazy with PHP.
Look, PHP is still here because it works *well* and within the community there is a solution for damn near anything. Don’t believe it works well, then seriously answer the question why it’s still so popular? In 12 years or so I haven’t found a problem with the language that I couldn’t get around relatively easily.
I’m a classically trained programmer, but these days mostly write in PHP and .NET, but if you have a job paying more I’ll write in whatever the hell you want me to and I promise I won’t question how cool you are… :)
10.25.2010
David Rudder
There have been a lot of good responses. As one of those “elite” programmers who look down on PHP, I thought it might be a good idea to give my 2c.
PHP is great for small, quick websites. But, it’s tough to code good large websites. Anyone who wants to build a simple homepage with a little database access in Java is freakin’ nuts. Anyone who wants to build an enterprise system with batch processing, sensitive data, and offline processing would do best to look outside PHP.
PHP is a dynamically typed language. As David Echols points out, this means that many errors a compiler would catch are not caught or have to be caught by QA.
It binds to Apache as a module, instead of using IPC to communicate with a monolithic application server. This means that session sharing and global variables become really weird.
PHP doesn’t have support for threads or background processing. And, no, piping to the unix shell and throwing the process in the background doesn’t count.
Finally, there’s all the weirdisms of a programming language that tried to take the easy way out. pconnect and magic_quotes_qpc are probably the worst.
Anyway, that’s my 2 cents. Anyone who tells you PHP is one of the worst languages is simply wrong, but there are times to use a hammer and times to use heavy machinery.
10.25.2010
Reid
David, good post. These are the types of arguments that so rarely get presented by those bashing PHP. Likewise, those who know enough to make these types of observations are rarely the ones telling you how much PHP sucks.
“PHP doesn’t have support for threads or background processing.”
Why not pcntl_fork()?
“PHP is a dynamically typed language. As David Echols points out, this means that many errors a compiler would catch are not caught or have to be caught by QA.”
I’ve always felt this to be a weak argument against any programming language. I’d argue that this actually makes good developers better by teaching them to become less reliant on the compiler and to write better code the first time. Just my opinion of course.
10.25.2010
David Rudder
Hi Reid,
Thanks for the reply. I hope you don’t mind a long, rambling reply to you reply.
pcntl_fork() creates a sub process. It’s better than PHP4’s answer, which was to use exec, but it’s not the same as threading. You lose memory sharing, have to implement your own inter-process communication, and forking is more expensive than threads. Take for example sending large number of emails on behalf of a user. With threads, you can write status directly to the user’s session, where with fork(), you’d have to write the status to a shared database. I know that’s kind of a lame example, but my point is the ability to interact between threads that you don’t really have with fork().
As you pointed out, fork() is less portable than threads. I’ve been lucky or persuasive enough to have linux servers for the most part, but my dev servers have been Windows, and it’s tough to develop like that.
I’ll have to disagree with you on the typing issue. In general, a design which makes it easier to write correct code is better. It’s way too easy to screw up the type and end up passing nonsense into SQL statements. Some of these can be really tricky to identify in tests. With a strongly typed language, at least you know the variable is defined and the right type.
Programmers don’t pay more attention when it’s more difficult. We just create more bugs. Strongly typed languages are more difficult to write in, but they make more solid applications.
10.25.2010
Chris Robinson
I’m curious what your definition of small,quick websites is because in my experience it has been sufficient for every website I’ve ever had to write. Of course my experience is limited to a moderate amount of traffic (200k-400k visits/month), but just about every site I’ve had to build involved some sort of batch processing, sensitive data (I assume you mean data that needs secured?), and offline processing. I’m curious how PHP has forced you to different/better languages regarding the things you’ve mentioned. Maybe I’m missing something.
I’m so used to PHP debugging is quite easy for me. In fact I find it almost as easy as when I’m writing in C#, assuming my environment is setup properly.
“session sharing and global variables become really weird”. What do you mean by “weird”? Maybe I deal with this and simply don’t pay any attention to it, but where does this cause problems? In my current job I use PHP via fastcgi to IIS on Windows (MS shop) now but even when using it as an Apache module I don’t remember any major issues.
As far as PHP not supporting “background processing”, wouldn’t pcntl_fork count or is it doing something behind the scenes that invalidates this? Of course this doesn’t work with Windows, which definitely caused some issues in the past for me. This area is actually my biggest complaint of PHP.
Maybe, back in the day, but magic quotes are deprecated as of 5.3.0 and were *highly* discouraged well before that. Pconnect is also generally discouraged, but in some cases it’s useful to improve db connect performance, I don’t think I’ve ever used it. So I think maybe you mean weirdisms of a programming language that provides *programmers* with an easy way out, although they certainly don’t have to use them. It don’t see it as developers of the language taking the easy way out. Please correct me if I’m missing your point though.
10.25.2010
Jonathan W
I sooo want to work for you :)
10.25.2010
DemoGeek
I think you’ve nailed it correct…the language with the right foundation makes a difference than the language itself. Yes, I hate that extra character (->) than just the dot (.) to invoke anything in PHP (I come from a C++ background) but that’s a minor inconvenience.
I think PHP with CodeIgniter (or some nifty framework) would cut it any day for anyone.
10.25.2010
damu
PHP is world in itself and it rocks! ;)
10.26.2010
Bill
Fascinating to read you guys comments. I’m a hack programmer, at best (Excel Visual Basic, basic level, learning java script to run acrobat for some basic office automation). I appreciate the passion I see in your posts. You guys love your work. That is cool, whether you dig PHP or not.
Cheers.
10.26.2010
Tim
Fascinating to read your comment. I appreciate you appreciating other people’s passion. It’s pretty rare, I feel, for anyone to realize that programming is a lot more than just a job. In many respects, programmers and artists are much alike. Career and lifestyle usually go together.
10.27.2010
aizuddinmanap
ewww,i like php.
10.27.2010
ryan @Learn Poker
Just a newbie to all of this technical information. Such a nice blog to read here, however. Look forward to learning much more information soon!
ryan
10.27.2010
David Rudder
So, you’ve heard about why I think PHP sucks. Now, let’s talk about why it’s awesome! Hey, I’m a liberal….*everything* is done in shades of grey and *nothing* can have a straight answer.
PHP is concise. Try writing a “hello world” program in Java. It’s an exercise in frustration. If you want to crank out something quick, PHP is an obviously good choice.
PHP is object oriented. This is why we don’t do web programming in Perl any more. Yes, I know you can do OO in Perl. but it’s kludgy.
PHP has some pretty good libraries. The database support is kind of crappy, but it’s there and it works. And, it even supports using unix domain sockets for communicating with the server. Similarly, the curl support is nice, as is the various PEAR modules. Not that Java/C# doesn’t have the equivalent, but without these, PHP wouldn’t be quick to use.
Weak Typing! Yes, I listed weak typing as a liability, and I believe it is also an asset occasionally. If all you need to do is to iterate over an array, having to formally declare your variables is a major pain.
Speed. There are all sorts of arguments over whether Java or PHP is faster. In benchmarks, these comparisons are valid. But, most real world Java apps rely on a heavier framework, with caching, input validation, clustering support, etc. These things slow down the app, and app development.
Fun! With PHP you can crank out something cool very easily. There’s nothing more fun than showing off your mad skillz.
Cross-Platform. Maybe it’s not as xplatform as Java, but it’s better than C#. Yes, Mono…but Mono’s still halfway-there.
Good IDE support. There are tons of IDEs which support PHP well. vim and eclipse are the only 2 I’ve used, but there are scores of others. I’ll start the next fight…eclipse rocks, everything else sucks!!!!
In case anyone thinks I’m an anti-PHP bigot…I run my website on drupal and I work for a company who’s B2C site is on PHP. The truth is, I’m an anti-ruby bigot. Hey, I have to be a bigot of some stripe!!!!
10.27.2010
Manoj
I’m not painting the monalisa! I don’t need my code to *look* beautiful, as long as it is readable and well documented – that depends on the programmer not the language!
Secondly, I don’t want features that I do not use. Namespaces are great. But wonderful applications existed before and will exist hereafter – with or without using namespaces! Its not what a language has, it is about what you use it for.
Finally, get a job people. Code more, comment (in your code) more, keep up with technology. Quit bashing!
Love what you love. Don’t hate the rest. Otherwise if PHP 6 were to include everything that you say it misses today, be ready to eat everything that you just crapped out!
10.27.2010
Patrick Chukwura
Hey,
Being basically an Atlanta native and a coder (although not in PHP…i’m more of an Objective C, C++ kind of guy) I usually hear that Atlanta has a great selection of code savvy individuals.
I’ve heard of MailChimp for years, but actually just found out this week you guys were based here in Atlanta thanks to an Atlanta Business Chronicle article. Maybe I’m alone, but perhaps if you guys were more vocal/apparent locally, developers around town would seek you out.
Anyway… keep up the great work!
10.27.2010
Horatiu Cristea
I know the feeling. I was one of the programmers who thought that PHP is junk. I spent few years with ASP, and then some more years with .net (C#) and I had a brief encounter with ruby & rails and then got familiarized with Python.
10 years later PHP became my “weapon of choice” and using php we developed great apps, medium to large scale. What’s important is that PHP does not limit you.
10.28.2010
J. Toman
I used to feel that way, but I’ve come to realize that it’s not PHP that’s the problem. It’s PHP programmers. PHP is the low hanging fruit for anyone wanting to try their hand at web development, and so most bad web developers end up knowing only just enough PHP to get a project past a customer whose criteria for success is “it’s pretty”. Maintenance, scalability, security, the things that make up the craft of web programming regardless of what language you’re doing it in, are by definition unknown to most bad web developers, who, as I said before, are working in PHP. But projects like the WordPress core, or PHPExcel are examples of solid OO PHP code. So it’s certainly possible to write good PHP code, it’s just that statistically not many PHP coders are doing it.
10.29.2010
Michael
Exactly.
05.20.2011
joff
Why would you come across as apologetic for using PHP? Yahoo and Facebook are driven by PHP ;) These are the largest sites on the Internet. So it’s a-ok.
10.29.2010
Startup Guy
Just knowing that Facecrook uses PHP is enough for me to use Java, or C, or Assembly–anything but PHP.
Seriously, though, your team is to be congratulated for building a killer app/service–despite your hideous choices of technology platform and business location.
10.29.2010
Tom
I don’t give a damn what programming language the guys at MailChimp use. As long as they keep MailChimp “sexy”.
:)
10.30.2010
David
As a dinosaur generalist (programmer, DBA, IBM mainframes, Assembler, COBOL, DB2, MySQL, sqlite, HP minis, Windows from 3.11-7 x64, OS/2, ASP, Rexx, Clist, VB, autoit, PHP, Linux, etc.) I can’t speak for code beauty/elegance, but I’ve participated in my share of technological religious wars. My take is that for the vast majority of cases there are many “right” answers for many different practical reasons. For the minority of cases where there are some extreme design constraints (probably like MailChimp’s) technological solutions evolve/are invented, and if the company continues to be successful, then those solutions can be judged to have been “right” and paid-time emotionally arguing against it is time wasted (which doesn’t detract from THIS interesting discussion – but noone is going to change anyone’s mind on this comment stream!).
I also think that the “ewww” response doesn’t come from people who understand that ANY situation requiring significant scalablity requires solutions that probably won’t look “sexy”. “Sexy” is surface-level and exciting. “Commitment” gets the job done over the long haul.
10.30.2010
Justin Noel
Haskell. I’d never heard of that one before. So, I looked it up. Here’s the nice error I found :
http://www.calendee.com/images/haskell_error.png
Since everyone is harshing on PHP, I must ask about Haskell. Their official site is down. Is it a bad programming language or a bad programmer?
10.30.2010
Ron Stauffer, Jr
Wow, Mailchimp is one of my favorite apps, so I’m personally offended that they would criticize php! (Just kidding).
I really have no idea how someone could criticize php though. The fact that Facebook and WordPress are built in php is proof enough that its worthy of serious attention.
Personally, php is perfect for almost everything I do, and I’ve never had issues with it! It’s certainly my favorite.
10.30.2010
Alex Mulin aka Ambal
Wow! you guys are in the same situation we are in Ulyanovsk, Russia (bit.ly/ulyanovsk). We make shopping cart software called X-Cart and it is 100% PHP. Ulyanovsk is a kind of “where and what it is? Do people live there? Really?!?!” town in Russia and “genuine kul programmers” say exactly the same “eewww and ugh” about PHP.
I just want to note that really cool programmer learns how to code in PHP or any other language in a month or faster and his/her main goal is not what language to code in, but what product to make and show people.
Mailchimp is used by half of a million people worldwide including us, folks from Russia. And it is created using PHP.
X-Cart used by tens thousands online merchants worldwide and it is in PHP as well.
PHP rules forever!
11.02.2010
MIke S
PHP is awesome, and so is X-Cart! I’ve used X-Cart at least 4 or 5 times over the years (going back as far as 2003) and it’s by far the best shopping cart system out there. Were I to be in a position to need a cart for myself or a client, I’d definitely choose X-Cart. (FYI: NO AFFILIATION with X-Cart. Just thought it was cool that I saw a random comment on a blog from someone from X-Cart)
08.29.2012
chris potter
love php! nice to see people still building powerful web applications in php, so my favourite. we have used asp and cf and even some perl. php all the way i agree with a previous comment with v5 you cant go wrong
11.08.2010
Arun Rajeevan
After reading the post, I started to roll down through the comments. It seems curious for me.
Just because, I wanted to start a freelance life and most of the stuff that people really want (WordPress, Drupal, Jumla!, different e-commerce solutions) are in PHP and in heavy use.
Being a Comp.Sci. degree holder who started programming in C/C++, then did programming in Java and Now working with Python, I wanted to know why this is so.
PHP: I looked once, 2 year back exactly; At that time I found that, code is within presentation itself. I didn’t like the idea, just because I love to write xHTML and CSS (separation of presentation from data) and progressively enhance with JavaScript. And developing in PHP will just ruin my beautiful markup.
But, now I realized one thing, for the client, it’s just the finished product that matters. And PHP being easy to learn for a beginner (I hope they tried Python too), It’s in wide use. And I heard that PHP5 is a total revamp. So I want to look at it again (and then use CodeIgniter).
I’ll tell one thing for sure,
Developing in Java isn’t fun. It’s more code, messing with a hole load of XML files and slow (not to mention complex).
You just don’t need it, unless you are a big corporate with big & complex site and lot of money to pour into.
Python is very good at express development(I’m using Web2Py now), PHP too (but give an eye to structure the code properly from beginning or select a good framework.)
So, to conclude, Language doesn’t matter if you can make perfect (or near perfect) soup that please client with your choice of language.
12.02.2010
VI
Frankly, I’m disappointed. All this time, I thought the monkey was delivering my mail.
02.10.2011
Vilo
I guess that php is easy enough for a chimp to use and sophisticated enough for mail chimp. Groovy…
03.22.2011
SF
PHP bad programming language ?
Not true !!!
Because PHP is *not a real programming language* at all but a *scripting language*.
(Like it’s prettier cousin JavaScript, or in “better” circles newly named “AJAX” fairy liquid…. *grin*)
:D
Meaning that you can’t (unless I have been missing something) make native running (without browser as it’s playground) application with PHP.
Sure, you can open files and read/write to them and do lot’s of cool database stuff with PHP, just like with real programming languages….
But so long as it run only on server’s and needs client browsers for interaction it will stay just
as a scripting language ….
Examples of scripting languages:
JavaScript (needs browser)
PHP (needs browser AND server)
ASP (ditto)
SQL (yes, because you can’t create self-standing applications with pure SQL only)
etc…
Examples of programming languages:
C
C++ (learn this first instead of Java, no matter what your university proff will say … you will thank me later)
Basic
Pascal
Assembly
Java (yes, this half-bastard cousin of C++ can be finally considered real programming language now that the VM is not absolutely necessary anymore …. unfortunately)
etc…
Not programming languages (scripting or real) at all (and if you know only these don’t you ever dare to call yourself as a programmer !!!):
HTML
CSS
Flash (Yuck!)
06.25.2011
Mike M
How’s that old saying go?
It’s a poor carpenter who blames his tools.
I know and work with plenty of programming languages, and by far my favorite is PHP.
sure it is not the most “sexy” or robust language, but that just adds another layer to the puzzle that is programming.
07.19.2011
Kwpolska
“PHP programmer” is thought to be incorrect, too.
07.19.2011
zou
You can write PHP code in 5 min that just works.
You can do it in 10min in Python, Java, what not, and it will have complex structures.
PHP is not _bad_ per se. It’s less _cool_ and you can make ugly code with it more easily.
07.19.2011
PhpHater
OK, let’s look at Facebook… oooh look they are trying to run away from PHP as fast as they can as it has badly limited them.
Hmmmmmmm maybe we should look at new social applications, Lets look at Google+, oh yes they use PHP obviously… no wait, they are ALL JAVA!!!!
hmmmm I wonder why, let me check, oh yes it is because PHP is for hackers, not proper developers, All OO developers understand this fundamental flaw in PHP, and when you have to store a session for a web application in a DATABASE rather than memory your “fast PHP” suddenly has a MASSIVE IO overhead.
07.19.2011
Alexander Williamson
Yes, but then the DB should take up the slack. You need distributed sessions when working with farms, so just write to a fast disk if it’s a major pain.
07.19.2011
PhpHater
OR you could use a much better environment, not just a pretty hated platform, that isn’t even a platform, it is a scripting language that is easy to pick up, but poor to use. Pascal was the same, and even the inventor of that complained people tried to use it for real development.
07.22.2011
Steve
Sorry, you lost me at “We’ve built a framework”. teh thought sends shudders down my back, even now as I type.
On a side note, programmers who know the power of Java but hate the syntax should try out Groovy, a JVM language with scripting syntax plus lots more. Trust me, you’ll thank me :)
07.19.2011
PhpHater
agreed, Groovy is excellent.
07.22.2011
Steve
I’ll just add that Grails is an enterprise JVM framework inspired by RubyOnRails but built on Groovy/Java (GroovyOnRails=Grails). Convention over configuration, great MVC syntax, robust Java tools (Spring, Hibernate, etc), tons of community plugins… Pure bliss to develop with! Take a look.
07.22.2011
lova
PHP is like IE, it’s exists, but there are far more & better ones. You can live with that, when doing it custom for your problems, but man.. it’s time to move on.
07.19.2011
Anon
If you have ever used Java, you will hate PHP.
07.19.2011
Marcos
I’ve been programming PHP for the past 6 years, and, in this period I studied other languages (JAVA and C#) just to learn more about PHP itself … try PHP 5.3
02.01.2012
Ed
PHP was the first programming language I learned. JavaScript is now (at CH. 6 in Beginning JavaScript) the second. So I’m not elite. It gets the job done or it gets the hose, yeah?
07.19.2011
Ken
This is ridiculous, a true programmer is language independent, skilled in multiple languages and able to utilize the best suited language for the platform. The quality of code is also dependent on the skills of the programmer. You can write solid PHP code, as well as you can write solid Python, Java, Ruby, etc…
Stop blowing your language horn, grow a pair, and own up to the fact that you fail as a programmer simply because you are not open to using different languages for different purposes.
The answer to the questions “which is better / which should I learn — PHP, Ruby, or Python?” is simple: learn all 3. Diversify yourself and master 1 at a time, as a result you will become more valuable.
I support Mail Chimp’s use of PHP, it is not necessarily the most efficient language for the service they provide, but it clearly fulfills the requirements of the platform.
07.19.2011
Anko
I can write php, indeed I do at work often. The problem isnt in being able to use it – the problem is that once you’ve seen something better it is PAINFULL to write php. It’s not fun.
Most people who like it don’t understand the alternatives because once you do, php is like programming without an arm.
07.20.2011
@dariobarila
I used php also to manage the automation of graphical overlay of a television station:)
Php it’s great!
07.19.2011
Jens Dalsgaard
PHP is just a tool, it is what you do with it that counts.
Many years ago people thought at if you used Frontpage you made crappy websites. While many people did, it is not the programmes fault.
Using word, does not make you a writer either.
I love the monkey-business that mailchimp is up to, no matter the technology platform used.
07.19.2011
Andrew Neely
I loved John Siracusa’s comment: “I’m not a PHP expert, but I’ve written enough PHP in anger to know what I’m talking about.”
I’ve finally picked up a bit of PHP, since there’s so much work out there. It’s definitely got a lot of rough edges to it, but for the problem domain that it developed around, I see the attraction for some people. It’s a quick and dirty way to add MVC dynamic behavior to websites on almost any web hosting solution out there without having to worry much about your deployment.
That’s why Marco Arment uses it, and he always struck me as a bright guy. I would love to see a proper debugging environment for it though…
07.19.2011
Joel
Hi,
I just started using PHP again and as a programming who is proficient in a few languages, php is definitely one of the worse to work with. There is no comparison with programming ease of C# or Java compared to PHP. However, I decided to use PHP because it is so popular and there are so many open source frameworks for it. It really makes a lot of sense to come proficient in PHP if you want to use open source content management systems. When it really comes down to it, I guess I agree with the author…php may not be the prettiest language, but it does the trick. And until more developers switch to something else, it does have it’s uses.
07.19.2011
dbg
Funny kind of blog post. Most working developers have had their hands in lots of different languages and we all just have our personal preferences. PHP has a bad rep that is well deserved because its a hard language to really enjoy, but almost nobody with any serious experience would say its a bad language. How can it be bad? It works, its economical, its well supported, its modern (ish), its relatively easy to learn, and it can be made to scale well. Thats alot to recommend.
HOWEVER…its really hard to like it. Its ugly. Its too verbose and prone to excessive boiler plate. It lacks some of the most powerful and expressive language constructs. Its a bit too tied in to MySQL and annoying to make it work with non-rels. And most of all, its just all over the place. There’s such a huge volume of awful hacky bad PHP out in the wilderness there that its easy to find examples of PHP that make you want to vomit.
So its almost impossible to like the language. But nobody should dislike it either. Its got plenty of virtues.
07.19.2011
Pisco
The sole fact that this discussion is going on, is enough proof that PHP is a very capable tool (to be strict, php is not only a language).
Why, or which way that is achieved it not relevant. You may present a ton of technical/theoretical evidence that it’s ‘clunky, bad, crappy, cluttered, etc.’ but that’s just a strict analysis of its technical characteristics, it doesn’t matter much when discussing if it’s a valuable tool.
It’s a fact that many companies make shitloads of money with it, it’s a fact that is hugely popular, it’s a fact that many are very efficient using it.
Seriously, you can call me a bad programmer and consider other languages superior, better design, etc. but, does it matter? Go and code in your favorite language and be happy. Do other languages need any proof their value? PHP surely doesn’t.
For the record, I do consider PHP ghetto-designed, but I could care less.
07.19.2011
Roch
PHP is fine for the web, it’s just not really fun to use imo.
07.19.2011
Aaron
Is there any other language that can rival PHP’s documentation? If not, PHP will always win imo.
07.19.2011
David Rudder
C#
07.20.2011
Anorgan
I concur with the post. I’m a PHP developer and I’ve built various applications using it, large and small, and diverse. Don’t see the need to go RoR or Python or (insert your flavour) because I always manage with PHP, although it was built as a template engine.
Keep on PHPing
07.19.2011
David Rudder
A lot of people have made the point that PHP is easy and you can write production-ready applications in it. True, true.
What no one’s talked about is having to extend those production apps 6 months later, after the initial developer has moved on.
All the structure of a Java program is for a reason; future maintainability. It’s important. You can get some of it through frameworks like the one MailChimp has made. But, nothing beats compile-time error detection.
07.20.2011
Kailash Yadav
It’s wonderfully written article. Java or Dot Net people think the PHP is not that good langugae but its growing day by day to become one of the popular Programming language.
07.21.2011
Andy Jeffries
Maybe a typo:
“process well over thirty million emails … generating tens of millions of bounces”
Sounds like you’re not getting a very good success rate ;-)
07.21.2011
Raphael
You probably can turn shit into gold if you try hard enough. That don’t mean you should.
If you ‘fixed’ PHP creating your own framework(!) and now you need to hire good developer capable of handle such environment you are doing it seriously wrong. You created a babysitter for yourself.
Image how much you would be able to get done if you hire good developers AND didn’t have to train them in your in-house tools PLUS actually having to maintain such framework.
There’s a couple reasons for using php(legacy code, common language for developers) for a new project but the ones you mentioned aren’t in my opinion.
07.21.2011
Steve
“nothing beats compile-time error detection.”?? I am a Java developer, and even I cannot believe you just said that! Compilers should NOT be relied on for any error detection. That’s weak sauce. You should depend ONLY on TDD methodology, with test cases in a testing framework like JUnit.
(BTW, this is a very strong argument AGAINST the “benefit” of strongly typed languages; you should be writing test cases for much more than just type safety, which gets covered for free as a side benefit for testing code QUALITY.)
07.21.2011
Dave Rudder
In general, as programmer should know about problems as close to the development process as possible. Unit tests, in theory, should catch most errors. But, often they won’t for days, even weeks, when you integration process is run. Faster integration process means a faster turn-around. But, no integration process will be as fast as seeing the error in your IDE as you type.
Besides, compile-time error detection doesn’t preclude unit tests. They test for different things. Unit tests exercise your business logic. Compile-time error detection prevents stupid mistakes from typos, bad clip-n-pasting, whatever. I think both are critical, though if I had to give up one, I’d keep compile-time error checking.
07.21.2011
Luís Dalmolin
I think the problem with PHP is the bad programmers. Because the first think you build usually is in PHP and people start with it. You don’t find bad systems in ASP or JAVA because they are not in the web.
07.27.2011
Toby
There is several factors to consider:
– size of the company and number of programmers and money you can spend per month. If you can afford it, it might be worth to have your own framework in the long-term (no matter what language)
– the problem of all frameworks in all languages is, the time you spend on debugging and doing things the frameworks was not supposed to be doing, it increasing the more complex a framework is
– Java has better development tools then PHP and is older, more mature, more professional. However, when you are using PHP you hardly ever have to change your code just because there is a new PHP version. In Java you always keep in getting updates from maven dependencies from all kinds of people and companies and most time is spent on hunting down getting your old code to work again with new libraries
– in PHP I never spent much time on finding an error. In complex Java projects sometimes several days
– RubyOnRails – i dont know: a fashion? When I look at the code I think: “why should I learn a new language?” and “what have they not spent their time on building a framework on top of PHP or Java” ?
If you go for a PHP framework I would recommend anyone YiiFramework. For Java Tapestry5 and for RubyOnRails I would re-use existing code.
PHP programmers are cheaper then RubyonRails experts or J2EE experts..from an economical point of view it is good to go for PHP.
If you are scared of your code being stolen when you outsource, go for Java and outsource only libraries.
08.03.2011
Christian Piper
Some of the comments bashing PHP on here are just plain comical.
I for one was not shocked that MailChimp was built on this language, it’s more than capable.
Scaling out these days is cheap, very cheap, and PHP is perfect for this task.
As for the snide remarks that CakePHP is slow, really?, production is a breeze and with a bit of jigging can be made to do some incredible tasks with incredible ease and speed, clearly you’ve never taken it out of dev environment, or you’re just doing it wrong!
08.07.2011
Fabio
Ah, w8, FB is using php?
09.15.2011
Reset Printer
yes for web i prefer only php ^_^
01.04.2012
Mike Meyer
PHP grants freedom to do things however one wants. This is bad and good. Sick of the crying hipsters touting different languages and rating them all. If you want conformity and a lack of freedom, get out of open source and go Microsoft. They are about as conglomerate as you get.
PHP is fine and good. It is not a hodgepodge of bad ideas. It is a flat system you can use, abuse, and unfortunately there are some baddies who use it as well. Hey guys, maybe it is kind of like Linux.
Perception and the value of doing things differently is just not what it used to be, I guess. Copy pasta away kids!
01.30.2012
Dave Rudder
Mike Meyer,
You’ve made some assumptions that I think are incorrect and should be fixed.
First of all, the people on this board, and programmers in general, are not “crying hipsters”. Technology moves fast and good programmers need to stay up with the times. Using new technology isn’t some sort of aesthetic, it’s our job description.
PHP isn’t a flexible system that allows you to work your way. It’s actually far more restrictive than Java, C# or the other “enterprise” languages. Example: how do you spawn a thread in PHP?
PHP doesn’t give you the freedom to do things however one wants. It’s good for making simple web pages, and that’s about it. If you want to build a bigger system, like MailChimp or FaceBook, you have to spend so much time on the framework, compilers and other nonsense. It would be faster and cheaper just to send all your developers to a class on Java.
PHP isn’t like Linux. Linux evolves over time, throwing out bad ideas. For instance, Linux no longer relies on i386 architecture, or uses compiled-in modules. PHP still uses pconnect and still doesn’t support prepared statements.
Go back to the original blog post. The author makes the case that they’re in a bad position to hire the best developers. It’s easy to extrapolate that they, thus, use PHP as a sort of lowest-common-denominator. I can understand the need to do this as a business. But, to be proud that you are a lowest-common-denominator developer is a really bad idea.
Dave
02.01.2012
Marcos
Hey, we use PHP 5.3 here at groupon, and I can say for sure, that PHP is one of the best (if not the best) language for web development ever…
02.01.2012
Ryan Sharp
Blub. Look it up. PHP is it.
03.01.2012
Paul Chersulich
I have 11 years experience in web development and i would say php is perfect because of the easiness of use, implementation and how well it runs, it works on any standard server, you don’t need so much experience so the costs are lower and with java you can grow what php does, but java is bad as only java, but with php you can make anything easy, fast, cheap and with high speed pageload without a problem. That’s why it’s the number one web development language. The others are too weird, bad performing, slow to create something even with an experienced developer. If you know php and java well you can make anything, absolutely anything you want :) just to know what you do. If i were you i’d stick to php and java and leave bullshit ruby which is poor in any way :)
03.08.2012
Dave Rudder
Okay, this thread needs to die now. I’ll harness the power of Godwin’s Law.
Hitler used PHP.
03.08.2012
tubbo
That’s really cool! I feel like working for Mailchimp or Facebook would be special because you’d get to see these state-of-the-art frameworks that they’ve built, since nothing of the sort exists in the PHP open source world.
However, I’d like to point out that a lot of the big win with Mailchimp and Facebook comes in their UI framework and JavaScript/pub-sub skills. What I’m very interested in is how minimal your PHP framework must be in order to support such heavy client-side load.
04.01.2012
RB
For the web PHP is perfect because of its procedural and OOP capabilities, it runs the biggest websites in the world – ie. facebook, wordpress. I think that programmers see themselves as better because of their personalities, not because one language is actually better than the other, alot of it is preference. There’s pluses and minuses to many of the programming langauges out there, I prefer PHP over anything else, I’ve worked with C# and CF. CF is easy, but expensive and you have to learn “adobe” programming “speak”. And C# isn’t open source and free, there’s more differences, but I think it is more preference than difference.
09.05.2012
Igor Santos
Hi there!
I got curious with this part: “It’s true that the platform wasn’t really designed for what we put it through and it hurts us from time to time, but that is to be expected. ”
Do you think that another language would do better if you started with it? Why?
(I’m not trying to start a flamewar, just understand your reasons to say that)
10.20.2012
Chad MailChimp
It’s hard to say for sure. One of the problems is that I can’t go back in time and re-do MailChimp in a different language. I have enough experience with enough languages to know that they all have parts where they break down, but I can’t say whether or not it’d be better or worse without actually doing it. I will say that I know of more PHP VM bugs than most other languages I’ve used, but I’ve pushed the PHP VM harder than those other languages as well, so who knows? We’re all just aggregating anecdotal evidence and making the best decisions we can based on that. Context is too important for generic advice to work very well.
10.22.2012
Christian Piper
Chad, what are some of the major problems you’ve faced with MC and PHP?
10.22.2012
Chad MailChimp
There are a couple broad categories of major issues we’ve run into:
The fact that PHP4 style errors like notices, warnings, and fatal errors still exist and are still used is still a problem. Null pointer exceptions (call method on a non-object) is a fatal error and really shouldn’t be. Error suppression (the @ symbol before a line) is sometimes used in libraries to turn off some of the more obnoxious of these warnings, but tends to hide other problems. Calling a non-existent function using call_user_func() throws a warning, not an exception or a fatal error, but calling a non-existent function generally is a fatal error. In general, PHP5-style exceptions are unequivocally better than PHP4-style errors but they’re still around. Oh, and getting the line number of a warning or fatal error without a stack trace unless xdebug is enabled is also quite bad.
The fact that PHP has a configuration file that can change the behavior of the language is a significant problem. If you’re doing shared hosting I can see the appeal, but otherwise it makes it impossible to test code across systems without verifying that the config files are equivalent. In our environment, it by far causes more harm than good.
PHP prior to 5.3 had issues with using reference counting for garbage collection without weak references, which means that any tree structure would leak memory. Since we do a lot of long-running background processes in PHP, that mattered. We had to do our own explicit destructors to remove any circular references before the objects were collected so that they wouldn’t leak. That has been much better in PHP 5.3+, but some bits of MailChimp are still designed to work around this fundamental issue. Similarly, PHP 5.2 breaking flock across fork boundaries (https://bugs.php.net/bug.php?id=47227) was a huge deal since we used flock and fork all the time to handle concurrent processing pools.
Finally, PDO using a destructor to close the connection without an explicit close method also causes all sorts of problems. If you have a dangling reference somewhere you can leak connections and it can be hard to find the reference. If you’re forking heavily, it means that any database connections in a child process that gets forked will close the parent’s connection when the child process terminates.
In general, PHP has been okay to work with. There are other complaints I could make, but it can get really specific. We use PHP to do long-lived daemon processes and tons of non-web stuff, which is an edge case for the language. Most of the stylistic parts of the language and things that people tend to complain about with PHP don’t generally matter when it comes to building the kind of stuff we build.
10.22.2012
Rami Gb
It’s funny i am reading this and i was just reading the release notes of php 5.5.0, so this is an old post two years ago, please note the huge difference in syntax and functionality and even core concepts that happened in PHP … for example i like this new feature introduced in 5.3.4 (i guess):
$class = (new Class)->find_by_id($id);
today they introduced “finally” … finally lol.
Anyways i was just trying to show how fast PHP is catching up while maintaining the simplicity and ease of deployment it had :).
ps : i code in Ruby most of the time lol.
11.17.2012