Language choice motivated by greed

scrottie on 2009-09-10T21:31:09

With this recent publicize Perl movement, I've been thinking about how to tell people that Perl is great. Specifically, how to sing Perl's praises in response to criticism. I've explained how meta Perl is, using B and B related hacks as examples. I've explained how it's not just another C like language, but incorporates radically different ideas taken from sed and awk that combine in powerful ways but scare people who are only familiar with procedural or OO languages. No one cares. It's futile.

I've also participated in several "what language should I learn?" discussions now. Generally, I praise Ruby, Perl, Python, and a dozen other language, depending on the style and temperament of the learnee, but diss PHP. No one cares that PHP mangles text in attempt to escape it and that PHP programs dominate the bugtraq list disproportionally.

Rationalism doesn't enter the picture. Neither does deliberation about personal style and a community that matches their own. Instead, if they see pretty sites done using PHP, they'll assume that somehow, magically, sites they do using PHP will be pretty. And they're probably right. Likewise, they'll learn Ruby if they want a turn-key MVC to start plugging actions into (I don't know wtf actions have to do with MVC, but whatever). They'll pick up Java is they want to do something "Enterprise" and ".NET" if they want to do Microsoft Windows UI stuff or Web stuff that integrates with MS Win. Maybe they'll learn Perl if they want to do some sysadmin-ish stuff or text processing. Even though there's little awareness of it, the whole thing seems to be as simple as "X language is good at Y".

And this is a realistic, practical approach if you consider that they merely want to tread the path most trod, not blaze a new trail. They want to do exactly what countless other people have done before so that people can tell them how to do it, and so that the snags are out. In fact, if mod_php returned a pretty web page without having one other PHP related file on the system, they'd be perfectly happy, as long as they could come in and tweak it easily. New programmers don't trust themselves and they certainly don't trust you. They trust those few things they can see with their own eyes -- pretty sites with URLs with ".php4" on the end. Literally, they're asking themselves, "how much can I get for how little effort/interesting/caring/work?". Telling them to care is counter-productive. So is telling them that something is interesting -- they don't want to be interested. Telling them about multiple steps ("first you must learn Perl, then...") is counter-productive.

Wal*mart never hassles you about updating your BIOS or updating your Microsoft Windows install from CD before connecting to the 'net. They just give you a poorly made computer with no support whatsoever and let you fall on your face. Superficially, this seems easier to everyone -- there are no *apparent* hassles. The pretense that everything will "just work" is disingenuous but essential. I think people don't buy computers from far more helpful mom and pop shops exactly for this reason -- accepting help is a chore.

Moose is good and Moose is great, but the real win would be to automatically install modules, automatically call the OS's package manager to install libraries and other deps, to have created PHP before php did (or after) and have a libperl linking executable that outputs web pages (period), and most of all, to have a sandbox mode enabled by default (tired idea, I know) where users can write code without getting yelled at by humans, only by the computer, even if just because the code is labeled (all is fair if you predeclare) as "babytalk". Perhaps this would be a mix of strict, diagnostics/warnings, and a Perl::Critic policy that tries to help them in only the most immediate sense likely to be useful to novices in the short term.

Dunno.

-scott


Shebangml?

Eric Wilhelm on 2009-09-11T00:04:53

It's sort of what PHP should have been in that your templates are just templates and it only executes actions if the interpreter allows them.

But that's an engineering feature. I can't tell you how to sell it on merit.

Perhaps what we need...

Alias on 2009-09-11T00:39:57

Is a Perl::Tiny?