Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Programming Mantras

by Juerd (Abbot)
on Jan 21, 2002 at 13:03 UTC ( [id://140350]=note: print w/replies, xml ) Need Help??


in reply to Programming Mantras

No mantra for me, that would ruin my music :)

I always try to keep these in mind:
  • use strict; (A year ago, I wouldn't have said so, but -w and strict have become very close friends :)
  • Use modules when appropriate (but not always - I still prefer using simple regexes)
  • Think about modularity. Even for very simple tasks, I tend to make an OO module these days, and it really helps to clarify my code and to refactor where possible
  • Order is important. I use guards (return unless ...;) instead of nested ifs (if (...) { ... } else { return }) if possible
  • Indent, Indent, Indent, Indent :)

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://140350]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found