

Ewww, You Use PHP? - moozeek
http://www.mailchimp.com/blog/
http://www.mailchimp.com/blog/ewww-you-use-php/
======
hackoder
What you need to understand (and most of us hackers too) is that there is a
difference between the 'hacker' and 'get shit done' mentality.

Programming is something I've done for the last 10 or so years (in various
forms). It is essentially the only activity (in terms of 'work' or career)
that I enjoy. The engineer in me just enjoys making things 'perfect' (where
perfect is a definition perhaps only I understand, but generally its something
built on solid engineering principles. Well-tested, reliable, modular,
efficient, etc). When code looks 'just right', I enjoy the code regardless of
whether it is bringing me any $$$. In that sense, for me, engineering is a fun
activity, and not 'work'.

The hacker in me will enjoy a well built piece of software for its engineering
brilliance regardless of whether the software got anything done at all.

In the last year or so I've been able to isolate these personalities and
perhaps merge them. I do not scold the hacker just because he wants to try out
new languages every month and is opinionated about his favorite ones. I get
pissed off when this stops him from getting shit done.

I'm glad for the hacker in me who cares deeply about the tools (languages,
IDEs etc) that he uses. Its this hacker that makes my job 'fun'. It is this
hacker that has helped improve the quality of my code and my thought process
for building good software. The 'getting shit done' would never have been
enjoyment enough if it were not for the hacker.

------
Raphael_Amiard
I think you can write good software in any language. Moreover, PHP is a
powerful language, in its last versions at least, it's just that the way it
has been developped would make anyone serious about programming language
developpment vomit.

But that's not really a problem.

I guess the problem is not that good devs can't code in PHP. And when they
focus on the task at hand, they might not even notice. Because PHP has
everything you need. I'd prefer coding a website in PHP than in Java, C, or
C++, because PHP is dynamic, has first class functions and the kind of stuff
you need to be expressive.

One of the problems is that if you think too hard about the fact that the
language you use is suboptimal, it will affect the pleasure you take from
doing your job.

The other problem is that a lot of PHP code is really horrible, so people have
grown to associate PHP with bad code.

------
pornel
PHP's warts are shallow — syntactical quirks, disorganized standard library,
idiotic config options.

In practice you disable stupid options, don't use quirky parts of the
language, set up your IDE to autocomplete functions, and PHP stops getting in
the way.

What you're left with is a decent OO language, which recently got namespaces
and closures.

It's OK speed-wise (with APC) and has got stable implementation.

~~~
loewenskind
If you have to go learn what things are dangerous and must be shut off, and
what parts of the language to avoid, surely it would be better to just use a
system that doesn't have these kinds of issues?

Imagine buying a car where the salesmen was saying "this is a great car, it
will get you where you want to go cheaper and faster than anything else out
there. The only thing you have to remember is; 40% of the buttons, pedals and
handles in the car will actually make it explode into a rolling fireball if
used. Don't do that. You'll also need to open the hood and physically remove 2
or 3 things that are even _more_ dangerous. Oh yea, don't ever put anyone or
anything in the back seat. If you remember all that, this car will be a
dream!". Would you use such a car? I wouldn't and I wouldn't use a language
like that either.

~~~
pornel
Are you talking about C++ perhaps? ;)

There's php.ini-recommended in the distribution and it's well-commented.

Not using variable-variables, undeclared variables, globals, unsanitised
variables in paths, SQL without prepared statements, etc. is common sense and
applies to other languages too. PHP might just bite harder if you lack that
common sense.

~~~
loewenskind
>Are you talking about C++ perhaps? ;)

C++ very much applies. :)

>Not using variable-variables, undeclared variables, globals, unsanitised
variables in paths, SQL without prepared statements, etc. is common sense and
applies to other languages too.

This is a subset of what you have to avoid in PHP. Further, things like
globals _can_ have uses. That's the difference with a really poorly designed
language: there are things in there that have no good use case. Not things
that are only used in rare cases, things that should never be used.

------
nir
"Despite its popularity, PHP is considered by the programming elite, almost
without exception, as one of the worst languages currently in use today"

I would say, the blogging-about-programming elite, rather than the actual
_programming_ elite. I haven't coded PHP in years, but some of the most
brilliant devs I know use it when it fits the task.

~~~
zokier
Ok, I'll admit, this may sound a bit trollish, but if PHP is not one of the
worst languages, then what languages do you rank below PHP? C comes to mind,
not as a bad language itself, but lack of web libraries, but that's about it.

~~~
sp4rki
I wouldn't call C a worse "language" than PHP by far.

~~~
pornel
It has messy stdlib (gets()!) and lots of features that you can shoot yourself
in the foot with (software security would look very different if it had arrays
like D).

~~~
program
The C standard library is very clean. gets is left in the C89 and C99
standards for backward compatibility an deprecated right now. Nobody uses gets
nowadays.

------
mgkimsal
Someone else may have mentioned something like this, but I can't find it, so
I'll chime in.

Transitioning to Ruby or Python or Scala or anything else will not make
anything magically better. I recently converted a Rails project to Grails
(actually, I'm in the middle of the conversion). I'd thought "it's Rails -
we'll just go in and fix the current issues". It was a horrid nightmare of
undocumented crap. It was started in 2006 - Rails 1, and had been added on to
for nearly 4 years, and was still Rails 1 (1.2). No useful inline comments, no
unit tests, undocumented magic method overrides for basic stuff that wasn't
compatible with future Rails versions, and so on. It was horrid. But hey, it's
Rails, right? Must be magically better than PHP!

I went back and forth on whether to rewrite in PHP or Grails, and either would
have been fine. Why? Because part of the rewrite process is to use modern
techniques - with a big helping of TDD tempering the process. Oh, and version
control. Yeah - 4 years of a project with 0 version control is not fun to deal
with.

So... I'll take PHP with a team of people using sane schedules, TDD/testing,
version control, internal and external documentation, and other niceties, over
Ruby for the sake of Ruby. Now, modern Ruby/Rails with all those niceties vs
PHP with same niceties? Probably a more even draw, with no clear cut choice.
But that doesn't seem to be brought up in these discussions.

Frankly, most of the stuff people point to as awesome about Ruby (or Groovy,
in my case) in isolation can be detriment - metaprogramming in general can be
confusing to someone new to the code without proper documentation as to what's
being done. Whether those docs are in tests, inline or external is beside the
point. Typically when I come in to a new code base in any language the
documentation just doesn't exist (or, better yet, it's "self-documenting"...
right...).

End of rant - PHP really is fine when used with proper development techniques.
Most languages are. In my experience problems start (and get worse over time)
when people rely exclusively on the _language_ alone, rather than language +
commonly accepted dev techniques.

~~~
raganwald
You'll take language X with team A and process 1 over language Y with team B
and process 0? Help me understand what, if anything, this says about languages
X and Y?

~~~
mgkimsal
In some ways it doesn't, which was the metapoint. People get _extremely_ hung
up on "php sucks" or "python rules" or "C# kicks ass", but the language is
only one portion of the equation. How the language fits in to the bigger
process of development is a _huge_ factor that is often/usually ignored in
these discussions.

No, actually, the teams (people) could be the same. It comes down to lang X
with sane processes (testing, documentation, version control, etc) vs lang Y
with no (not enforced, standardized, adhered to) processes.

~~~
raganwald
That isn't a strong meta-point, it's like saying it isn't the bike, it's the
cyclist. Sure Lance can beat me on a junker bike. But he can't win the Tour on
a junker.

So if you want to succeed, and you have a choice about language, you still
need to pick the best language for your circumstances. The importance of
people and process doesn't invalidate that any more than the importance of
Lance Armstrong invalidates the importance of bicycle engineering in the Tour.

All that being said, I agree with the last sentence of your comment. It's just
that I don't meet many people who say that with the right language they don't
need anything else, so I'm not sure who you're debating. For example, all of
the Rubyists I know fetishizes testing. None of them have ever said to me that
thanks to Ruby, they no longer need tests. What they actually say is that Ruby
makes testing easier, which is your point.

So yes, process and people are important, we all agree. So who, exactly, says
anything to the contrary?

~~~
mgkimsal
I see where you're going, and I'm probably not as clear as I wanted to be (and
probably don't have time to be!)

The ruby community is interesting because of the testing focus, which possibly
negates my point a bit. However, I meet plenty of Rubyists who are _so_
focused on tests (which are easy to do because of the language) that they
eschew documentation, of any kind.

I've talked to more than a few Rubyists who are now in the 'my code is self-
documenting because Ruby is so elegant and my method names and variables are
so awesome and I can metaprogram anything I need that there's 0 need to have
any comments or documentation - just read my code and the awesomeness of Ruby
will overtake you'.

I don't particularly care how elegant your code is, having some inline
comments will not hurt. Having external documentation, and sane commit log
comments, and so on, are vital in my view. I'm not picking on Rubyists here
specifically, that's just the few that spring to mind.

~~~
raganwald
You know what? I need a browser plugin that delays posting all comments until
I've finished my second coffee. You make some good points, I suspect we agree
on almost everything.

In a way, good languages are interesting because they make good practices so
easy they're invisible.

Which makes me very interested in the question of documentation. Throwing
tests out the window as documentation for the purposes of this discussion, how
do you feel about DSLs as one form of self-documenting code?

~~~
mgkimsal
Not opposed to them, and probably have some good points (javadoc/phpdoc is
probably, at a stretch, an example of that.

I've got to run now, but email me at mgkimsal@gmail.com to carry on :)

------
cosmok
I use PHP at work for creating not only web applications but, also to do a lot
of non-user facing backend stuff. It's great to know that someone out there is
using PHP at a much bigger scale for backend stuff.I hope he shares more
technical details. If you don't like PHP, fine, but, don't think all PHP
programmers are stupid.

I once had a Python programmer looking at the kind of stuff that I was doing
with PHP and he was surprised that such things could be done in PHP.

This is an actual conversation that I had in a meetup:

 _Guy1: If PHP were to disappear, it would bring down a lot of the web with
it, wouldn't it?

Guy2: Nah, but, that would be the case if Java or .net were to disappear.

Me: (to myself)Wtf!

Guy1: But, most of the links that I click on the web end with .php.

Guy2: um.....

Me: (to myself)pwn3d!_

~~~
derefr
I wouldn't say that anyone has the impression that "all PHP programmers are
stupid." Rather, it's more that PHP, on top of attracting O(N) competent
developers like any other language, also attracts O(k >> N) _marginal
developers_ who barely know enough to get off the ground, and couldn't really
manage to code in any other language. When you randomly select a
"representative" PHP coder (such as by listing "knows PHP" as a criterion for
resume submissions), you get a marginal one.

~~~
cosmok
Stupid was a bit too strong, but, I stand by what I said based on my
experience. Articles like these exist partly because of the belief that PHP
programmers in general are not competent. You do not hear such frequent
rumbling on Python and it's practitioners. One could apply the same O(N)and
O(k>>N) logic there as IMO, Python is not harder to learn/program in compared
with PHP.

------
csomar
I really don't understand why a language is so important. Since you have your
own VPS or dedicated server, you can use C or any other programming language,
create executables that do complex and targeted work and send the result to
PHP, rails, python... You can use all of the languages at the same time. It
really doesn't matter what main language you are using for routing your
websites.

PHP is cool. I have found (<http://fatfree.sourceforge.net/>) and I couldn't
be happier. It's similar to Sinatra and has everything a small app needs. It's
simple and make separation easier. But if I need that complicated data
structure processing that can be done with python or perl, I'll just write
down that script and run it through php and get the results.

Between, this statement makes no sense for me

>> This is just going to get bigger and bigger as we grow by 500% or more
_every year_

~~~
smiler
Thanks for this, this framework looks real interesting!

~~~
dpritchett
Agreed! This one snippet from the fatfree docs dispelled a good bit of my
lingering hesitance to revisit PHP after a good while away:

    
    
      F3::route('GET /about',
      	function() {
      		echo 'No subliminal messages here...';
      	}
      );

~~~
code_duck
The problems is that many popular hosts have not deployed PHP 5.3 yet. So, if
you're planning on using this framework, you need to make sure your host and
anyone you distribute it to are using at least 5.3. This nullifies one of the
common reasons for using PHP ("it's supported everywhere").

~~~
bcosca
this is fast becoming a myth. a lot of hosting companies are moving up.
godaddy already offers php 5.3 shared hosting.

~~~
code_duck
That just means the situation changing as time goes on, not anything about a
myth. Of course at some point everyone will be running >=5.3, but I still hear
about PHP 4 after all...

------
pirko
Link to the actual blog entry: <http://www.mailchimp.com/blog/ewww-you-use-
php/>

~~~
moozeek
Thanks, it was not possible to edit the URL once I submitted.

~~~
olalonde
<http://news.ycombinator.com/item?id=1819050>

------
dunk010
The web stack at Last.fm is PHP, for better or worse. It's certainly not a
pretty language. Or consistent. Or advanced. I've got a theory on why so many
large websites use PHP though - from Facebook, through Flickr, Yahoo and
Last.fm. I think it's a combination of PHP being the best option available at
the time many of these large websites were set up, and it being a very simple
language. Yes, I actually think that can be an advantage. In PHP you don't
spend any time beautifying things. You don't bother writing "clever" code
because you can't, really. Writing in PHP pushes you towards making "the
simplest thing that could possibly work" - which is so in sync with the most
fruitful startup mentality.

It doesn't mean I like it though. It's still as ugly as sin. After all these
years programming it I still get thrown by ($needle, $haystack) ($haystack,
$needle) and have to look up which variant this particular function uses. I'd
much rather be doing it all in Ruby. Or Lisp.

~~~
Joeri
The string functions are (haystack, needle), the array functions are (needle,
haystack). And, no, knowing that doesn't actually help me because I always
seem to mix them up anyway during coding.

------
staunch
Why not transition to a different language over time? One that more great
programmers want to use?

There's no reason they couldn't (over the course of years) move to another
language. I'm not suggesting a total rewrite, but they could start writing
entirely new subsystems in a new language. It's very rare to have 100% of your
code in one language anyway.

Recruiting great programmers is one of the most important things in a software
startup. Why stick with PHP if it makes that far more difficult?

~~~
shin_lao
Probably because you overestimate the added value of Python and Ruby over PHP
and underestimate the cost of language migration.

Language is not that important. Your engineers are. They will easily
compensate for suboptimal tools.

The best hint for this is that most (>70%) of the money goes into salaries.
Not software. Not hardware. Not office space. Salaries.

~~~
points
and if an engineer moans and moans about his tools, and refuses to work in
anything but his favorite language, I would say he's an absolutely terrible
engineer.

Great programmers can make great stuff using anything.

~~~
btilly
_Great programmers can make great stuff using anything._

Just because I _can_ doesn't mean that I _want to_.

I'm willing to work in lots of environments. In the last 2 years I have done
projects for pay in Perl, PHP, Java, C++, Python and various in house
languages you probably haven't heard of. However I have to be paid a healthy
premium for the displeasure of working with PHP. And if I was asked to do it
all the time, eventually I'd leave and find a better job working in something
else.

~~~
slantyyz
I thought the actual programming problems also mattered to great programmers.

Would you rather do something boring in a beautiful language vs. something
interesting in an ugly language?

~~~
msbarnett
That's a false dichotomy. There are plenty of interesting problems to be
solved out there offering the use of better tools than PHP.

~~~
slantyyz
Only if they're greenfield projects. But if you're a job hunter, and there's a
really interesting project using legacy code in a language you don't like, are
you going to turn down a job offer because of that?

------
ucheokeke
What's so bad about PHP? I’d assume the goal in web development is the end
product or service and not the means to it. It seems easy to miss the forest
for trees, and delve into cult-like arguments of whatever software stack is
hip.

~~~
rtp
> I’d assume the goal in web development is the end product or service and not
> the means to it.

I don't think I agree. The end product's possibility to be exist at all
depends on the mental health of your employees, how efficient they are, and
what tools they use. Someone who is unmotivated due to using a language or a
tool that is horrible will work only on work morale as a resource for
motivation, and it's only a matter of time before that resource runs out, and
they'll start feeling miserable and perform sub-optimally.

I don't have an opinion on PHP, although I've made a few cool things with it
and enjoyed coding in it, so I don't think it's necessarily that bad.

------
thenbrent
I used to be in the "eww, PHP" crowd, but only until I _really_ started using
it.

It doesn't have to be the security blackhole or spaghetti monster it's made
out to be.

~~~
lowglow
I agree. Every language is as good as the programmer that uses it.

------
pilif
I'm maintaining a huge web application mostly written in PHP. We (well. back
then it was just me) began doing this back in 2004.

Back in 2004, PHP was a very sensible solution: It was the language I knew
best (we had little time for the project, so going with a language I knew felt
sensible), it was easy to deploy and back then, there weren't that many
alternatives anyways:

Ruby was in its infancy, for Python you had thread safety issues with
mod_python or you went CGI, Java was and continues to be just ugly. JavaScript
back then was still just a toy language. No Node.js or anything.

That would have left me with mod_perl, but looking at where we are today, that
would have been an even worse decision it seems.

Fast forward 6 years.

The application consists of over 100'000 lines of PHP code alone now. It's in
production use for many customers which serve tens of thousands of end users.
It's not only a traditional web application, it also serves as an API for
custom-made tablet pc applications (before we had the iPad), for GPRS-
connected barcode scanners and last, but not least, for native Windows Clients
(all developed by our company, using various languages).

While I really hate some aspects of PHP by now and I would love to have a Ruby
or Python codebase to work with instead, rewriting all of this is out of the
question.

Customers depend on this to work exactly the way it works now (they panic even
if a link is two pixels off - welcome to the enterprise).

While I might be able to exchange some components with something else, I don't
see the benefit it would provide - it would do nothing but make maintenance
harder because I'd add another dependency to keep track of.

The only thing I could do is rewrite the thing. But by now, there's more than
30 man-years of work that went into this.

Sure. Redoing it wouldn't take the same amount of time, but considering it
would have to look exactly the same (probably I couldn't even get customers to
accept different URLs), where's the point in that?

OTOH, despite being done in PHP and tailored to sometimes crazy customer
requirements, the code base is sufficiently clean to work with and it's
constantly improving. Bad parts get factored out, good parts arrive, so it's
not all-bad.

We are embracing new technologies as they become available and fit our
product. Our CSS is now written in SASS, we moved from pure DOM scripting to
Prototype to jQuery, we make use of the latest features of PHP (now Closures
and anonymous functions from 5.3) and of our database (constantly running
latest Postgres).

Even though it's PHP, it can still be fun.

Considering recruitment: Granted. It might be harder to convince a good
programmer to work on this "ugly" PHP project. But a) we are not just doing
PHP (just mainly), b) the code base is, as I said, quite clean and c) even
though the code base might be in a language you don't like, the basic concepts
of our profession still apply.

You can still discuss and solve interesting problems and you can still create
great solutions to these problems.

If you don't want to take part in this adventure just because you don't like
the language this is done in, then, frankly, you are not the person I want to
hire.

Even though programming is the coolest thing you can do on this world, it's
_still_ a job and not everything can always be unicorns and rainbows. If you
can't see this, then I don't need you.

~~~
instcode
I hate to say this and I know I will be downvoted by "hackers" but I really
don't understand why people (who know limited or nothing about Java & blindly
follow the norm) always pick the word "ugly", "stupid" for Java? What superior
of PHP to Java when with Java I can program from a stand-alone app to webapp,
from client side to server side, from desktop to mobile app?... If you are a
coder, you must pick a language & a standard lib to be master, and I would say
that picking a language that only sticks to a very specific application
platform (web-only, desktop-only...) is a very bad choice. I started from
C/C++ and moved to Java and I feel very comfortable to use/study Python, C#,
Scala & Ruby.. but PHP, get off, never & never ever!

One last thing (to convince more PHP people to downvote me) is, if you are
spending most of your time on PHP or a web-only-language, you will never see
the beauty of asynchronous I/O, socket programming, threading, hooking...

Update: When I mentioned "web-only-language", I was thinking of people who use
& only use Ruby with RoR for web apps. I don't know how many developers who
can't distinguish between Ruby & RoR but I guess it's not a small number. And
of course, what I said is toward to those who aren't willing to learn new
things. They always think about web & only web.

~~~
pilif
beauty of threading? _shudder_

anyways. I have some reasons for my strong dislike of Java: a) checked
exceptions, b) no method pointers or something similar and c) lots of the code
produced by the community out there (and in the standard library itself) is
full of FactoryFactoryFactories and other typing intensive, mind-bending and
ultimately useless abstractions (most of them not DRY at all either).

Back in 2004 I did strongly consider Java though, but ultimately, I didn't
have time to implement this web application AND learn a new library (learning
the language is easy. learning the library is what makes you slow in the
beginning).

As a side note: Said web application also accesses locally connected barcode
scanners over the local serial port. Unfortunately the only way to do this
(aside of a locally installed client) is _still_ using a Java Applet which
I've also written back in 2004. So I do have the Java experience to know that
I don't quite like it :-)

~~~
brown9-2
_lots of the code produced by the community out there is full of
FactoryFactoryFactories and other typing intensive, mind-bending and
ultimately useless abstractions (most of them not DRY at all either_

So what? Why does the code produced by others in "the community" affect your
perception of the language and/or tools, if you aren't using their code?

~~~
raganwald
Whether you fall in line or not, the culture around Java is around writing
code to a certain style. Agree or disagree, there's an argument that by
writing in a style that is familiar to Java programmers, your code is easier
to read and maintain.

If you're one guy off in a corner, write however you want. But if you're not,
you have to take the culture into consideration. And if you are one guy in a
corner, why are you using Java?

~~~
Periodic
I just started working for a large enterprise corporation (one of the biggest
financial companies in the world). We have a lot of old code written in Java
that needs to be maintained. I've been trying to advocate new ways of doing
things, but almost every time the other developers will respond with, "that's
just not how we do things here."

Java has a very strong culture around it. I worked in academia and startups
previously and I didn't realize that there is a huge number Java programmers
who do nothing but program in Java. They aren't interested in learning new
languages and will only grudgingly learn a new framework. Their biggest
concern making sure the lowest common denominator can still maintain the
(unmaintainable) code.

An example is unit testing. Our current "unit" tests start up a JBoss
instance, connect to the development databases, and take ~5 minutes to run
just one test. But I've been told not to waste my time working on anything
more modular and that if I'm going to put in any time working on unit tests, I
should contribute to the framework everyone else is already using.

It can be quite soul crushing.

~~~
cruise02
Where do you sit? I'm on the 5th floor, by the stairwell.

~~~
raganwald
I was on two, but Lumburgh asked me to go ahead and move my desk downstairs
into the storage locker.

~~~
dhimes
Did you find the can of pesticide I left down there for you?

------
nadam
"So before you jump on that bandwagon thinking nothing interesting could
possibly be done with PHP"

The problem is not that nothing interesting can be done in PHP. Lots of
interesting can be done in any Turing complete language. It would be just
'plus points' if you would use for example Scala for the kind of task you
described. I just cannot see why to use a dynamic language in a task where
performance is important when there is a statically typed fast language which
is as good and as concise as Scala. It is not that it is impossible that I
would join a company developing in PHP. We have to make compromises all the
time. It is just that developers evaluate companies, and join the one with the
most 'plus points'.

------
Revisor
In this context I'd like to quote Peter Norvig talking directly here on HN
just a few days ago (in this case about Lisp vs Python):

 _In terms of programming-in-the-large, at Google and elsewhere, I think that
language choice is not as important as all the other choices: if you have the
right overall architecture, the right team of programmers, the right
development process that allows for rapid development with continuous
improvement, then many languages will work for you; if you don't have those
things you're in trouble regardless of your language choice._

<http://news.ycombinator.com/item?id=1803815>

------
billpg
Is it good software thanks to PHP, or in spite of PHP?

~~~
ElbertF
Because rewriting it in a different language automatically makes it better
software..? I don't think the language really matters.

~~~
billpg
When I first wanted to build a website, I wanted to use C, because that was
the language I knew best at the time. I'm glad I decided against idea as time
went on.

~~~
wnoise
Heh. I have written precisely one CGI. It's in C. It also does precisely what
I needed it to do.

------
Tichy
I have no doubts that complicated things can be done in PHP. Complicated
things can and were being done in Assembler, too.

It just is a red flag and makes me wonder about the sense of taste the
developers at a PHP company have. Therefore it would take a lot to convince me
that working for them is "alright". If they have bad taste, how are they
supposed to write nice code?

Having to learn their proprietary solution to scaling issues only is not as
tempting as it sounds. Yes, I am interested in working with scaling problems.
But learning a proprietary PHP hack is not going to help my CV that much.

------
joelmichael
I am a Ruby on Rails programmer from the early days. It is my platform of
choice. And yet, I still have massive respect for PHP. For me, it's the next
best option.

I worked in PHP for five years before I worked in Rails, and I think PHP is a
great language for web development.

~~~
roel_v
"I think Rails is a more modern platform. I think PHP is not the ideal choice.
But I think PHP is a great platform."

Yeah but here's the rub. You can't compare Rails with PHP. You need to compare
Ruby to PHP, and ask if the switching costs will outweigh any deficiencies;
and you need to compare Rails to e.g. Cake or Symfony or similar, and ask if
one language provides a framework whose advantages are so compelling that they
too will outweigh those switching costs. I have yet to be convinced.

(weighting factors may apply for dev experience with one or the other, legacy
code, hosting/infrastructure support, etc.)

~~~
joelmichael
I don't think something like Cake is a good comparison for Rails, and it's
honestly not how I think of PHP. Developing in PHP is making a collection of
functions and custom made classes hacked together, in my mind. I know there
are frameworks, but if you're going to use a fancy framework, you'd might as
well use Rails.

I wouldn't develop in Ruby without Rails, but I wouldn't develop in PHP with a
framework.

~~~
wvenable
I don't like rails. When I do web development, I do it in PHP, and I avoid PHP
rails-like frameworks as well. I prefer more control and most of projects
don't fit into a nice box for rails.

------
sp4rki
In this day and age the only real reasons to use php is because you're either
stuck with it and changing the code base makes no sense since you already have
a product built, because you're new and don't know any better, or because
you've been doing it for such a long time that you're so used to it you don't
see the languages faults anymore.

One of the applications I maintain is a convoluted machine made of half java
half php on top of Quercus, and if freaking drives me crazy. I think the only
thing I hate more than that is working in ASP.

------
wildmXranat
Well, I experienced a reverse ewww when I was interviewing at Amazon for an
Imdb job. As soon as I mentioned that my previous employer used PHP, I had a
very short and quite frank answer: Oh, what for? PHP is such a bad language.
So bad, that nobody should use it.

I was kind of floored since I didn't exude a fan-boy mentality, I was simply
answering the questions. That was more of an inner chuckle, but I wasn't
surprised by his answer at the end of the day. By the time the interviews
ended, I realized that PHP might be the last thing these guys will look at.

Coincidentally, I took another offer where the core is PHP + Symfony +
Doctrine. I was very impressed at how well behaved, structured and developer
friendly a good source base can be, no matter the language.

------
robryan
The trend I've noticed n recent years is that the PHP developer has to defend
himself when talking about language choice, much like someone who decides to
use .NET.

People never see the same need when starting a project in rails, even if it
isn't that great a fit. One advantage PHP has for me is that nothing is
abstracted away in a way that I don't understand the underlying components
because I'm writing my own framework. Sure certain aspects I'll grab some cade
as necessary but in general everything I'm doing I've either written it or
parts of it myself.

I get all the semantic language arguments against PHP and largely agree, this
has become less of a problem for me though with experience.

------
pbiggar
My bank supports billions of dollars of transactions per day. But they use
COBOL, so I will never work there.

------
petsos
These quotes from PHP's creator are very enlightening:

<http://en.wikiquote.org/wiki/Rasmus_Lerdorf>

------
mustpax
Can someone fix the link? It's pointing to the front page for the blog, the
blog post is here: <http://www.mailchimp.com/blog/ewww-you-use-php/>

------
code_duck
We always hear about Facebook using PHP as a justification for it.

Unfortunately for this line of thought, Facebook wanted to move away from PHP
3-4 years back, specifically to Python I believe, and realized it would be too
much work to rewrite their entire front end. So, they're trapped in PHP, not
using PHP because they think it's the best choice.

This was mentioned in the article announcing HipHop.

------
jarin
I used to be a PHP programmer, and now I'm a Ruby programmer. A lot of great
things have been built on PHP, I just don't like coding with it. To the folks
who build great things on PHP, more power to them.

~~~
slantyyz
You've got the right attitude. You just say you don't like it and move on.
Different strokes for different folks.

No point in being condescending about someone else's choice of language.

------
juice13
I work as a developer at a stock exchange. My department wrote and maintains
several business apps in PHP, including a report generation framework and
several realtime clinet/server apps.

I find it reliable, reasonably powerful and easy to use. It's major strength
is brilliant documentation on the official web site (this is a major downside
to Python in my experience).

------
yoyar
As someone who's written tons of Java/J2EE etc... and who's been writing PHP
for several years, I don't get all the PHP bashing. I've seen tons of garbage
code in Java, and in PHP. And I've seen amazing things done with both. It's a
poor carpenter that blames his tools. And yes, for many tasks I opt for PHP,
because it is fast for both implementation and performance. It's fun and it
works really well, as long as you know what you are doing. How's that
different from Java, Python, Ruby etc...? One more thing, if you want to judge
a language based on how much trouble you can into, what about C? Or what about
the threading and memory leak issues you can run into in Java? I mean, all of
these languages have massive pitfalls and none of them can effectively stop a
bad programmer from doing bad things.

------
corin_
"So before you jump on that bandwagon thinking nothing interesting could
possibly be done with PHP, think of us (or Facebook)."

Before I jump on this bandwagon I think I'll forget all about mailchimp, and
think about all the many, many, _many_ great companies (such as Facebook) that
use PHP.

------
nervechannel
"Email marketing" + "I thought you were cool" = cognitive dissonance

------
poink
PHP is fast and just about everybody "knows" it (which is a curse as much as a
gift). But as someone who made a living writing PHP and made the jump to
another language:

a) I find it more enjoyable to program in other languages.

b) I can generally get things done more quickly in other languages (feel free
to ignore this point if you're the opposite :P).

c) Aside from speed, ubiquity, and the docs on php.net (which are _awesome_ ),
I don't really get anything out of using PHP.

d) People will pay me more to program in other languages.

So yeah, I suppose my first reaction on reading "PHP" in any job description
is "Eww". It's not really because I think PHP is wholly unsuited for
programming, though. It's just not optimal for me, personally.

------
brisance
The "cool factor" of a language is inversely proportional to its popularity.

~~~
voidpointer
Just like with everything else...

~~~
bcosca
human progress was never a result of religious fanaticism. sticking to one
language because it is the "one true language" is a lot of crap.

------
igorgue
"Get out of languages, platforms that's the important thing" - Zed Shaw said
something like that a while ago

------
Yaggo
As opposed to its peers (eg. Ruby, Python), the original PHP was not a
programming language but just a collection of tools for HTML preprocessing.
Although the current PHP has nothing to do with the original one, and PHP 5.3
actually has pretty nice feature set with namespaces (finally!) and anonymous
functions, its "non-academic" roots still show off as general ugliness. That's
why I wouldn't recommend PHP to anyone as their first programming language
(been there, done that, nowadays a Pythonista).

------
klochner
PHP devs are the silent majority.

------
nopal
Can an admin update the link to: <http://www.mailchimp.com/blog/ewww-you-use-
php/>

The submitted link requires clicking a "More" link in order to read the full
entry. (And it will be out of date once they post another entry on the blog.)

------
Keyframe
I picked up PHP because it was like C (which I use since I was born) with
training wheels and some quirks.

It gets the job done, sometimes spectacularly, sometimes not so very much -
depending on who did the work. It's a workhorse, and has been demonstrated as
such millions of times so far. Performance depends a lot on deployment
strategy, but it can be fast.

I really see no point in bashing PHP. It's a tool, it has tons of
documentation, libraries and available helpful people. Sure, I'd like to have
some tweaks here and there, but with what tool wouldn't you?

There is a saying around here, roughly translated: Rusty cock minds
every(single) pube.

------
mcmc
I have been contracting for a company that has an in-house version of this
tool. We are able to push about 10 million emails a day, including processing
bounces, click, unsubs, etc, with a fairly straightforward set of python
scripts. Its not about the custom logic, its about choosing the right basic
building blocks.

Based on my experience, I doubt they need their "highly sophisticated" PHP to
do this -- plain old normal PHP would probably be fine so long as they choose
the right out-of-the-box software to pair it with. (nginx, postfix, certain
non-sql databases, and the right mysql setup)

------
hdeshev
Everyone has to make his/her choice of technology and MailChimp has chosen
PHP. That's perfectly okay.

I know PHP, and I've used it to put food on my table. Luckily that is no more.
I'd consider doing PHP again only if my wife and kid were starving.

My advice to people stuck with PHP codebases - start changing the site backend
first. Write everything not related to spewing HTML in a real programming
language, and slowly limit PHP use as a simple template-processing tool that
generates your app's HTML. Which is probably the only thing PHP is good for.

------
kloncks
I grew up coding in PHP and still love it to this day, so I agree with the
basic premises of this article.

The one thing that bothered me was towards the end. In trying to justify PHP's
coolness (which I am not arguing against), people continuously bring up
Facebook as an example, even though they've repeatedly stated that they wanted
to move away from PHP to Python years ago but realized they couldn't after
having hundreds of thousands of lines in PHP.

PHP's cool. I love PHP. But, let's stop using Facebook as an example of a
company "embracing PHP".

------
JimmyRuska
PHP is a pretty decent lazy language, it just could give rise to bad habits.
It also has a few odd irregularities in the naming of functions/argument
order. It's just a massive arsenal of functions for everything. For example if
people want to manipulate a string or array, newbies will often not pay any
attention to how often it gets iterated through redundantly. They just use a
bunch of functions that do what they want magically.

------
smiler
I have to say, I code in .NET during the day and have been considering ruby /
python for my own projects because the hosting costs are a lot less. I used to
do a lot of PHP and I keep thinking I should just stick with that.

Although it feels 'dirty', the only thing I consistently read about ruby &
python web apps are deployment issues and exactly the best way to deploy those
apps.

With PHP it seems very straight forward and an easy way to avoid all those
issues.

~~~
forensic
ASP.NET has always been the cleaner, nicer-to-use alternative to PHP. If
you're already good at .NET i see zero advantage to saving the few dollars
here and there that PHP would bring.

Your time as a human is far more valuable than the extra cost of an IIS
server.

Ruby and Python actually offer some language advantages tho. Personally if I
coded .NET in the day I would be looking at F# for webapps.

~~~
wvenable
Why F#?

------
alexyoung
I don't understand the "PHP is fast" comments. Whenever I've had major scaling
problems with PHP or anything else it's been due to IO rather than a
fundamental issue with whatever language I was using.

The things I did to fix the performance problems are generally language
agnostic. Improved database architecture, search indexer configuration,
clustering, memcache, etc.

~~~
wvenable
Yeah, PHP is slow. It's just that the speed of your language doesn't really
matter. What is, in my opinion, an advantage with PHP (but not exclusive to
it) is the whole share-nothing design philosophy and mod_php.

------
lusis
Speaking specifically of mailchimp, I interviewed with the a few years ago.
They are a seriously cool company. If you ever get a chance to talk to Chad,
ask him to tell you the story of DDoSing Mechanical Turk. Ignore the language
they use, mailchimp is an amazing analytics company.

------
shawnzizzo
Does your customer care which programming language you use? The true test is
if the application that was developed meets the requirements of the
customer/consumer. I don't develop for other developers; I develop for
customers that want the app to work.

------
bombarolo
> thirty million emails sent by tens of thousands of users every day

Damn! Are these all spammers?

------
btilly
_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._

He hasn't heard of Google? :-P

~~~
ryanwaggoner
Uh, does Google use PHP? I think that's what he's referring to.

~~~
btilly
Define "this environment". I took it to mean handling large amounts of mail,
in which case the gmail team has one of the most sophisticated frameworks,
period.

As for using PHP, I'm sure it is used somewhere, but it is not a popular
language at Google. Most Google developers have better taste than that.

------
trustfundbaby
I think this is the money quote in the article

"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."

------
coolgeek
moozeek -

It's 2010 - link the post, not the blog

~~~
roryokane
For posterity, the link to the post: <http://www.mailchimp.com/blog/ewww-you-
use-php/>

Edit: never mind, <http://news.ycombinator.com/item?id=1819021> already posted
it.

------
pkulak
Oh well, you built your own framework. That changes everything!

