Jeff Atwood takes on PHP, the language of choice around here, and gives is a good, well-deserved thrashing followed by the most insightful thing I've read in a while:
You've probably heard that sufficiently incompetent coders can write FORTRAN in any language. It's true. But the converse is also true: sufficiently talented coders can write great applications in terrible languages, too. It's a painful lesson, but an important one.
I, too, initially learned programming in BASIC (followed by a smidge of Pascal). Then I didn't program for a decade or so. Then what did I do? Perl, a language possibly more derided for spaghetti code than PHP. So in a way I should be doomed to be one of those relentlessly inflicting FORTRAN on the world. I don't believe I do. Why not?
Fortunately I have an obsessive-compulsive streak in me that hates inelegant disorder (in code--if you see my office or my Mac's desktop you'll see the organization fetish only goes so far). I like to be able to look at and immediately understand the flow and purpose of code without having to concentrate. I want to read a novel, not a Russian paper on the role of the Holy Fool in literature (anyone who has translated Russian liberal arts articles will wince in sympathy). Trebling my fortune has been working for the past seven-plus years with
a couple of guys who have similar biases to mine: code should be crafted, and a complicated hack is not necessarily a point of pride, but an indication that you didn't understand the problem well enough.
So when I joined, we quickly started adopting ideas from the Fusebox methodology developed for Cold Fusion. Then we started exploring object-oriented design patterns, and while we ended up stuck with some legacy code that implements singleton to a fault and isn't really architected well enough for unit testing, it's nonetheless been a psychic shock to go into Drupal's "implement a bunch of functions and rely on some global variables" world. But in PHP's defense, both applications, though neither of them is something I'd want taught in a software design course, work, and work pretty well.
I think the PHP community has something going for it that helps counter the low barrier to entry and plethora of applications written by inexperienced programmers: a constant envy and desire to ape Java. While Java has its own issues, and I have seen first hand from a course intending to teach Java to VB programmers just how badly you can program while still creating legal Java, it does have a heavy culture of software design and has lots of features that lend themselves to designed architectures.
Most modern frameworks in PHP implement ideas like MVC, and some even play with Aspect-Oriented Programming. There are lots of discussions on the forums for those frameworks on the "right" way to do things, in which people with experience in more rigorous languages pass on knowledge to up and coming programmers. And PHP itself has been adding
modern object-oriented features and cleaning up its act, though its legacy prevents a clean break with some of the worst of its excesses.
PHP succeeds because it gets a lot of fundamentals right: it's fast, it's relatively easy to deploy, simple setups don't require a lot of horsepower, and it scales relatively easily. But beyond that, it isn't so broken that you can't choose to program well enough to create the Facebooks, the YouTubes, and the Diggs of the world. But it's forgiving, so even if you don't program it with a really clean, modern architecture (like WordPress or SyntaxCMS), you can still deploy something useful.