note
Bod
<blockquote><i>The Monastery has also taught you to <b>write the tests first</b> because the act of writing your tests changes and improves your module's design</i></blockquote>
<p>You are quite correct - as usual...</p>
<p>However, I have extraordinary cognitive problems with doing this. Trying to work out what a module is going to do and how it will do it before writing a line of code is quite a leap of conceptualism for me. I do not doubt that I could learn this cognitive skill if coding and module design were my job but they are very much a sideline. At 55 my brain's plasticity is fading a little I notice which doesn't help.</p>
<p>Over in <a href="/index.pl?node_id=11141799">this node</a> it was suggested that I might like to create a module for Well Known Binary (WKB) from the work I had already done to read one file. I started writing the tests for that module but it has ground to a halt because of the issue above.</p>
<p><b>Back to this "<i>module</i>"...</b><br>
It didn't start out as a module. It started as a bit of throw away code to build an array. It then turned into a <code>sub</code> in a small script for my own very limited use. Then, and only then, did I think it might be helpful to other people as it is a relatively general building block.</p>
<p>I don't think tests are necessary for bits of throw away code. Nor for simple scripts that are only intended to be used by me.<br>
Do you think otherwise?</p>
11149996
11150002