<?xml version="1.0" encoding="windows-1252"?>
<node id="705411" title="Avoiding silly programming mistakes" created="2008-08-20 01:26:55" updated="2008-08-19 21:26:55">
<type id="115">
perlquestion</type>
<author id="668384">
missingthepoint</author>
<data>
<field name="doctext">
&lt;p&gt;Greetings, monks.&lt;/p&gt;

&lt;p&gt;This is a 'meta-programming' question, I guess... Recently I've been meditating upon the cause of the errors I make while programming. It seems that most of my errors are what you might call 'silly mistakes'.&lt;/p&gt;

&lt;p&gt;For instance, recently I decided to expand my mind and learn another programming paradigm (in addition to 'imperative', which is all I've had thus far). So I set out through perltoot, and learned much. Along the way I learned about destructors and how they must be named 'DESTROY'. So I proceeded to add a thus-named sub to my source file... which promptly failed to run. After 10 seconds reflection and a forehead smack, I had put the sub in my class's module, instead of the file which use()d that module. Then it ran. Doh!&lt;/p&gt; 

&lt;p&gt;My other silly mistakes are similar - they generally take 10 seconds to fix, but can take longer to spot, especially if sleep-deprived. What annoys me is that I waste time this way. If I was paying attention in the first place, I reason, I would be a more productive (and less stressed) coder.&lt;/p&gt;

&lt;p&gt;Can any other monks relate to this behavior? What are your strategies for avoiding those 'doh' moments? Obviously experience helps, but are there things I could do &lt;i&gt;now&lt;/i&gt; to reduce the number of silly mistakes I make?&lt;/p&gt;

&lt;p&gt;I eagerly await your monastic wisdom.&lt;/p&gt;

&lt;p&gt;P.S. Please be nice, it's my first post. :o)&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-668384"&gt;
&lt;font size="-1"&gt;-- email: perl -e 'print scalar reverse map { chr( ord($_)-1 ) } split //, "ufo/hojsfufqAofc";'&lt;/font&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
