Perl Makes Good Programmers

I bet you think that I’m kidding, right? Perl allows programmers to build extremely bad habits, doesn’t force discipline, encourages shortcuts that simply aren’t possible in other languages. But I’m actually serious.

I had a conversation with my new boss a few weeks ago that went something like this:

Boss: Do you know what data driven design is?

Me: No.

Boss: (google it if you don’t know 🙂

Me: Oh. That’s how I code.

Boss: Good

So it occurred to me to wonder why it was that I code that way, what with my lack of formal education and all. I went to the Pittsburgh Perl Workshop last weekend (my OpenID presentation went great, thanks for asking – I used sock puppets to describe the user/website/server interaction) and spent a great deal of time thinking about how perl people write code and why, and I realized that I code this way (with reusable, modular, configurable code) *because* I work in Perl.

The easiest way to get started doing something with Perl is to pull down some helper code from CPAN. All of that code (ok, not all of it, but most of it… well, ok, the parts I actually use) was written in a modular way, designed to be configured to work for multiple applications. The more time someone spends writing Perl code, the more likely they are to approach each new problem in a modular way (I need something to do A and B, and then C to tie them together) – this makes it easier to use CPAN to reduce your workload, but also means that when you write the code you’re likely to avoid hard coding anything in the program itself.

When I started working in Flex, I was a little frustrated that it was so difficult to find examples where developers had pulled the configuration information out into a separate file, but the truth is that’s not terribly surprising. First, there simply aren’t nearly as many examples of Flex code out there, so it’s harder to find any specific thing. Second, without the external community pushing developers to think beyond their current application, it’s easy to fall into the habit of taking the shortest path to “done.” Working with Perl (and some seriously critical programmers) for (ack!) thirteen years has given me an allergy to hard coding *anything* in my programs. Which makes it harder for me to spit out something quick and dirty, but makes the things I *do* make much more powerful.

flex modular perl

Dialogue & Discussion