perlmeditation
salva
These are mine:
<ol>
<li><b>Keep things simple.</b>
<li><b>Layering/encapsulation and good API design are the keys to good programming.</b>
<li><b>Too much abstraction is as bad as too little.</b>
<li><b>Minimize code dependencies and specially temporal dependencies:</b> I specially hate the case when you have an object that requires its methods to be called in a particular order and that is manipulated from different layers. Impossible to follow code!
<li><b>If you have to write some complicated piece of code, try to hide it behind and easy to use API.</b>
<li><b>Code flow must be easy to follow.</b>
<li><b>Perl is a powerful and expressive language, don't be afraid to use it to its maximum.</b>
<li><b>Avoid code duplication. Don't copy&paste. Boilerplate is OK to a certain degree.</b>
<li><b>Make your subs/methods meaningful.</b>
<li><b>Try to avoid helper subs/methods with long lists of arguments.</b>
<li><b>Don't use an object when a simple hash or array will do.</b>
<li><b>Speed matters, scalability matters, memory usage matters, IO matters. Keep that in your mind while programming.</b>
<li><b>When breaking some of the previous rules, document it.</b>
<li><b>Check the validity of your input (specially when dealing with external input), refuse anything you don't know how to handle</b>: Note that this does not go against the [http://en.wikipedia.org/wiki/Robustness_principle|robutness principle], they are orthogonal concepts.
<li><b>Write regular expressions as strict as possible.</b>
<li><b>Check for errors extensively</b>. Don't ignore them.
<li><b>Include internal consistence checks.</b>
<li><b>Add lots of debugging code</b> so that you may be able to debug problems reported by others even when you are not able to reproduce them.
<li><b>Depending on an external module needs a good justification.</b>
<li><b>use strict, use warnings</b>, selectively disable them when required.
<li><b>No TDD</b>, it gets on the way of my iterative design/programming thinking process (but if it works for you I am OK with it).
<li><b>Otherwise, testing is a very good thing.</b>
<li><b>Be consistent in your coding style.</b>
<li><b>And use a good editor that takes care of it for you:</b> actually I don't care too much about cosmetics, as far as blocks are indented it is OK for me.
<li>Finally, paraphrasing the great Salvor Hardin, <b>"Never let your sense of best practices prevent you from doing what is right!"</b>
</ol>