You use PHP because you don't know better.
adambard.com
adambard.com
+ PHP is universally supported, virtually out-of-the-box, on virtually every architecture, distribution, web server, hosting company, etc etc etc you could name.
+ The deployment story for PHP apps is better than it is for e.g. Rails apps, particularly if you have, um, people who are not primarily technical in charge of it. For example, if you can follow instructions, you can install WordPress, and it will take you about five minutes. Given a functioning Rails application and told to put it on the Internet, and assuming you're a competent systems engineer, allocating an afternoon to the project is not a bad idea at all. (Unless you already have made the upfront investment in e.g. Chef/Puppet/etc scripts to configure everything your app will need to get running. I have a project where I haven't, but I've got pretty good documentation on what needs to be done to bring up the whole environment, and it takes me 2 to 3 hours to do.)
+ Programmers are rare. Programmers close to your are rarer. Programmers close to you willing to work for what you're willing to pay are rarer still. Yadda yadda. All of this is true about PHP programmers but they're about an order of magnitude or two more common than e.g. Rails programmers.
+ Even if we concede that PHP is a language comparable to duct tape and bubblegum, I've got to point out that a lot of the world just needs duct tape and bubblegum. There is a web service running at my old day job, where hitting a URL is supposed to tell you when the most current backup of the database was taken, and that's it. It is written in PHP and was coded, tested, and deployed live in approximately as much time as writing this comment took. Rails -- which I love! -- is not a very good hammer to hit that nail with. (I've got an app or two on Sinatra internally, and while I like them, they feel inferior in this case to "We already have Apache up. Copy/paste one file and forget this was ever a task.")
People use PHP because they like it, or they're paid to use it or for any other variety of reasons. To argue it's because they don't know any better assumes the predicate.
People can rag on the language, but this post calls into question the intellectual horsepower of those writing the code, and I think that's unnecessary.
To wit, I'm sure it felt great writing this post, knowing how elegantly one can take down the practitioners of a craft without sounding exactly like a troll.
Makes me happy knowing all is right in the world.
I've shown a few of my friends Node.js and now they are on the same page with respect to PHP. One thing I've learned is that people don't want to learn until they are ready to learn so bashing their language never helps. I take the approach of trying to show them how to do something (usually with a video chat and start from scratch quick demo) in a better language framework and show them how it's less code, easier to test, easier to debug, better MVC framework, and faster execution. That's how I've won hearts and minds.
I've no problems with string concatenation. In fact, I consider overloading + as a concatenation operator to be risky in a duck-type environment. You could, conceivably, concatenate two variables when you meant for a mathematical operation to occur just by the type of the first variable.
I find things like $var->$foo and $var->{'duck_' . $i}() to be very powerful and good. Dangerous in the hands of an amateur, yes, but very effective when you know what you're doing.
And being able to do $myvar(), or $$myvar(), or $$myvar[0](), etc is absolutely awesome.
Programming in general is dangerous in the hands of an amateur; I'm just happy that I have the freedom to make these mistakes.
In regards to the require/ include operation... spl_autoload, and additionally PSR-0, exists for a reason.
It's funny/sad how closely this mirrors my feelings about Javascript
Software is just a mean to an end, and well, most of the time. Not all websites needs a super well engineered language to build. Not all "programmers" get to work on exciting problems that make them fill pages of their notebook and think for hours for a few lines of code.
I can sympathize with his sentiment though. I hate objective-c more than any other language I've ever used (except visual basic), partly because it's so popular. I see so many problems with objc that I'm flabbergasted people can get so emotionally attached to it, to the point of becoming defensive if I criticize it.
Perhaps some of the vitriol is due to these languages pretending to be something they're not - low level - when really they are just glue between more powerful components. In that sense, I wish they would just be full blown liaisons and do more work for me, instead of rigidly forcing me to fall into the conventions that handcuff me in more "formal" languages. PHP is not so much a language as a preprocessor. If it only had macros.. that's the one failing that really stings, although if it did, it would quickly devolve into something unreadable like perl, so perhaps it's for the best..
5.4 already added that.
Meanwhile the arguments for tend to resemble 'it works better than that language at deploying html anyway.'
It always strikes me as a form of hipster-ism, if a language is widely used (particularly) in the enterprise it has to because "people don't know better".
Even the title is condescending, "You use PHP because you don't know better".
Really?
Ok, take my case. I'm 33, I've programmed since I was 7, for money since I was 14, I've programmed in everything from z80 assembly through C, Turbo Pascal through Delphi and Visual Basic into .Net and Python.
In my late 20's I went back to school and got a degree in Software Engineering.
If you feel the need to insult others you know nothing about because of a language they use without knowing why they use that language then you are an idiot (in my opinion).
I've seen beautiful code written in Visual Basic that delivered real value and absolute monstrosities written in Python.
My latest (and quite large project) is written in PHP but hey I don't know any better.