perlmeditation
Crulx
To all the Perl Monks in cyberspace:
<p>
use strict;
<p>
If I could give you one piece of advice, that would be it.
Perl Monks around the world have proven that those two
words will save you more headache than anything else you
could possibly do in perl. The rest of this is my
personal advice written from horrible software projects
gone completely wrong. To you, I dispense this advice.
<p>
Enjoy learning Perl. Scratch that, actually. You will
never actually realize that you are learing Perl. But
trust me, in a few years you will be able to look at line
noise like the Solitare algorithim in Stephenson's
Cryptonomicon and think, "Wow. How the hell did I learn
enough Perl to understand that." You are not as
bad at Perl as you think you are.
<p>
Don't worry about performance. Well, you can worry about it,
but realize that in 6 months your little script will be
running on a machine twice as powerful and with ten times
the ram.
<p>
Object Orient Everthing.
<p>
Check CPAN every day. Submit to CPAN every other day.
<p>
Memorize all the $ funky character variables.
<p>
Learn LISP. Then go back and read the docs for map, join,
reverse, and all of the datastructure parts of perldoc.
<p>
Keep your old test programs. Delete your old datafiles.
<p>
Indent correctly.
<p>
Don't feel embarased for asking an "easy" question. Some
of the best Perl programmers I know ask "easy" questions
weekly. The best ones ask them all the time.
<p>
Be very kind to your hands. Someday you will have fond
memories of pre-carpal tunnel life.
<p>
Maybe you will code CPAN modules, maybe you won't. Maybe you
will use th $/ variable, maybe you won't. Maybe you will
learn everything about Perl's internals, maybe you will
never write a script more than ten lines. Whatever you do,
remember this one thing. There is always more than one
way to do it.
<p>
Program, even if you have no major projects.
<p>
Read all the documentation, even if you only remember
one-tenth of it.
<p>
Do not compare your code to Tom Christiansen's. Someone's
code has to be better than yours and it
might as well be his. Just learn from it.
<p>
Be very clear on the fact that Perl programmers belong
to a community. Try to learn about the others in this
community.
<p>
Program using only $_ and @_ once, but remember that
variables add to clarity. Program obfucsacted
perl once, but stop before it makes you crazy.
<p>
Think about, until you get an intuitive understanding,
why Larry says the three virtues of a programmer are
Laziness, Impatience, and Hubris.
<p>
Respect the main developers.
<p>
Be careful about your coding style, but be patient
with those who give you advice on how it should be changed.
Monks get very into their perl style and it can be hard to
read a program written in a different style. Asking it
to be changed is only natural.
<p>
But trust me on the use strict;
<p>
With thanks to Mary Schmich, who actually wrote the first one
<br>
---<br>
Crulx<br>
crulx@iaxs.net