Perl Proverbs

pdcawley on 2001-05-31T17:39:38

I had this idea while we were brainstorming Dave Cross's training course, Idiomatic Perl, (which we simply have to stop referring to as `Idiotic Perl').

Perl proverbs are short, often dogmatic pieces of advice on how to write good programs. I got the idea from the collection of `Go proverbs', which is a delightful miscellany of hints and tips for getting better at the game of Go. Some of these proverbs seem almost ludicrously simplistic, others seem positively gnomic. And some contradict each other.

But that's what we're looking for. Here's a few examples:

  • use strict;
  • Learn about references.
  • Use map instead of foreach
  • Use a version control system.
  • Use grep instead of map.
  • Optimize your code for readability.
  • foreach can be better than grep.
  • Keep it simple.
  • Don't be scared of necessary complication.
  • Study the tao of reverse
  • You're never too good to type #!perl -w.
  • Even when you're the only programmer, you're a member of a team.
The list goes on. Which is handy, because I hope to be giving a 25 minute talk on Perl proverbs at YAPC::Europe this year.

I'll try and discuss some of these proverbs in a little more detail in upcoming journal entries.