Over the last year have seen more and more people talking about best practices in PHP which is a very good thing, but at the same time, still seeing new developers making “mistakes” PHP allowed them to make. At the other end of the scale there’s developers who know a language well and can’t resist adding ‘smart’ features. That needs to be a golden rule of what not to do with dynamic languages – don’t extend the language (at least not using the language itself).
In PHP that probably means things like “don’t define a class String”. In Javscript perhaps it’s adding a property “superclass” to make inheritance possible. Meanwhile Python, which has a great design by default, draws things like this.
Trying to grasp the designers intent should be the first step of getting “serious” with a dynamic language. In the absence of a clear statement of intent (and PHP has many grey areas) it’s time to open the debate up with other developers.
The Platform Divide
Back to Koranteng;
Not to get into language wars but I’ll offer a bounty for whoever solves this issue. I want to be spoilt as much as a J2EE or .Net programmer is spoilt.
There’s a challenge ;) Sadly the big software houses are still missing this boat. The attitude is summarized by Thin To My Chagrin (Nov 2003);
But the best advice I can give you is simply use the right tool for the right job. The script languages are fabulous tools for their intended purpose. So are C# and C++. But they really are quite awful at doing each other’s jobs!
Personally think that’s a self fulfilling prophecy. It’s because the big vendors hold this kind of view that the state of dynamic languages is improving only incrementally, through Open Source (which may be a good thing). Microsoft does seem to be hedging it’s bets though, with the odd smart hire…
The counter, in favor of dynamic languages, begins with Strong Typing vs. Strong Testing and ends in results like wxPython, Gmail and A9.
In contrast to Thin To My Chagrin, Koranteng makes further excellent commentary in On rich web applications, AlphaBlox and Oddpost (with follow up here – uptime varies).