Apologies to the Ruby Developer Community

From Jimbojw.com

Jump to: navigation, search

Last week, in my article Defending PHP, I laid out my arguments for why I believe PHP is a great language. This spawned many heated comments and counter-posts, including a response by Yukihiro Matsumoto (Matz). Here I'd like to clarify a few points which I think may have been misinterpreted.

Note: Unfortunately, I can't read Japanese, so I am at the mercy of Google's abysmal translation of Matz's article. If I have misinterpreted anything, please let me know.

Defending PHP is not an Attack on Ruby

First, I'd have to say that Defending PHP was in no way meant to be an attack on the Ruby*. There are many, many things I admire about the Ruby programming language which I wish were present in PHP. Here is a short list:

  • nil as an object (as opposed to null)
  • True closures and proc blocks
  • Prototype-based programming
  • Ability to override methods on class instances
  • Operator overloading
* Although, admittedly, I did throw a few low-jabs at Java ;)

"Easy to learn" wasn't my idea

In the rebuttal article, Attacking PHP, Jon Candy uses the same format as Defending PHP. In his section "Irrelevant praise", he offers this:

PHP is great because it allows the new user to pick it up quickly!
Sure. And if the introductory material available covered good programming style we might not have a problem. In reality, every example PHP script is riddled with SQL Injection vulnerabilities, XSS vulnerabilities, and terrible programming. Most newbs never learn a better way of doing things because this gets them results that look good very quickly.

I'd like to point out that in Defending PHP, "easy to learn" is not a feature I ever meant to put in the PHP "win" column. I think the confusion stems from this excerpt from the "Irrelevant complaints" section of my article:

PHP allows/promotes poor programming practices
I call shenanigans on that one. PHP appeals to a broad audience, especially new coders, because it is ubiquitous. It's just as easy to write poor code in any other language (an Interface with exactly one Implementation anyone?)

In that paragraph, I was hoping to express that:

  1. New coders tend write poor code due to inexperience
  2. New coders are attracted to PHP because of its ubiquity (easy to get a hold of, lots of examples, tutorials, etc)
  3. Because PHP attracts inexperienced coders, PHP code in the wild may be disproportionately poor compared with other languages
  4. PHP does not "promote" poor programming habits (because correlation is not causation)

So in summary, I don't think PHP's appeal to new developers is a pro or con. Newcomers to any trade or technology are bound to make newbie mistakes.

I hope that clears everything up. As usual, I look forward to your feedback!

Comments

Got something to say?

Sorry, comments are disabled.

Masaki said ...

Don't bother your remarks. Matz only links to your article and doesn't mention to the content. His careless remarks is often mistaken for attacking PHP in Japan. He also says I'm not attacking PHP in another article. Hahaha.

--Masaki 06:39, 4 February 2008 (MST)

Jim R. Wilson said ...

Hi Masaki!

Thanks for clearing that up! I appreciate you taking the time to comment on my Blog - I am a big fan of Ruby, and didn't mean any disrespect. ;)

--Jim R. Wilson 11:53, 4 February 2008 (MST)

Kristopher Leonard said ...

mse1rj8al5dvu7u1


--Kristopher Leonard 20:00, 12 November 2008 (MST)

Ruben Duncan said ...

mse1rj8al5dvu7u1


--Ruben Duncan 03:59, 13 November 2008 (MST)