Clear questions and runnable code
get the best and fastest answer
Perl Comencement for the 2000 Classby Crulx (Monk)
|on Jun 15, 2000 at 09:06 UTC||Need Help??|
To all the Perl Monks in cyberspace:
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.
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.
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.
Object Orient Everthing.
Check CPAN every day. Submit to CPAN every other day.
Memorize all the $ funky character variables.
Learn LISP. Then go back and read the docs for map, join, reverse, and all of the datastructure parts of perldoc.
Keep your old test programs. Delete your old datafiles.
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.
Be very kind to your hands. Someday you will have fond memories of pre-carpal tunnel life.
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.
Program, even if you have no major projects.
Read all the documentation, even if you only remember one-tenth of it.
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.
Be very clear on the fact that Perl programmers belong to a community. Try to learn about the others in this community.
Program using only $_ and @_ once, but remember that variables add to clarity. Program obfucsacted perl once, but stop before it makes you crazy.
Think about, until you get an intuitive understanding, why Larry says the three virtues of a programmer are Laziness, Impatience, and Hubris.
Respect the main developers.
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.
But trust me on the use strict;
With thanks to Mary Schmich, who actually wrote the first one