arlen's blog

A Poor Craftsman (Sometimes the syntax IS the problem)

"It's a poor craftsman who blames his tools."

An old adage, but one I also believe. So don't take this as me blaming PHP for the bad PHP code I've written through the years. I'll take ownership for it, just like all the other bad code I've written in all the other languages before and since.

But sometimes PHP seems to actively discourage good coding habits.

Michael Booth, over at mechanicalrobotfish.com, is seeing the same thing.

He was writing a Drupal utility in ruby (pacem, read the post if you're outraged; I'm just being the messenger, here) when it occurred to him to wonder what kind of good testing tools he could find for PHP.

His quest led him to compare what he had known in ruby with what was in PHP, and the difference is drastic. Have a look at the differences between the two testing files and see what he means.

I know I've run into it more than once. It's quite possible to write good, even elegant, PHP code. I've seen and I've even done it myself. Still, the klunky syntax doesn't help; in fact it often gets in the way.

But the point here isn't to hammer PHP. I just want to encourage you to expand your horizons. Oliver Wendell Holmes once wrote "A mind, once stretched by a new idea, never returns to its former shape." In this specific case, someone who had encountered testing tools outside of PHP, brought the ideas back and is hopefully enriching the PHP culture with it.

Matt has a BarCamp session on exotic languages. Come on out for it, and if you happen to know about something off the well-travelled PHP/javascript/C# track, bring it along and show us why you like it.

Or, if you don't, come on along anyway. Get your mind stretched. And then bring that bit of stretch back to your corner of the dev world, and see what it comes out looking like.

You'll be better off for it.

Syndicate content