    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Trial &amp; Error</title>
        <link>https://members.accu.org/index.php/journals/768</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 11, #2 - Feb 1999</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c133/">112</a>
                    (20)
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Trial &amp; Error</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 February 1999 13:15:29 +00:00 or Wed, 03 February 1999 13:15:29 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="section" lang="en">
<div class="titlepage">
<h2><a name="d0e20" id="d0e20"></a></h2>
</div>
<p>One of my hobbies when I was in my early teens was building
radio receivers. I started off by making crystal sets (for those of
you too young to remember these were simple unpowered devices that
were fundamentally a tuned circuit and a simple diode.) In those
days commercial diodes were made from germanium though I
experimented with a number of other materials that exhibited
semi-conductor properties.</p>
<p>I quickly got into the habit of experimenting with just about
all aspects of the circuit. Finding the optimum connection point to
my metal bedstead to act as an aerial, trying home made condensers,
winding ever more complicated coils etc. Of course no great damage
could be done because the only power in the system was that which
the aerial was sucking out of the ether. Many of the bits I was
playing with came from my grandparents' box-room that was a
treasure chest of all manner of things from the early part of the
century.</p>
<p>This all took place over one summer holiday before I had to
return to boarding school. With my parents living overseas there
was no chance to resume experiments until the following summer by
which time transistors (germanium based) were available and just
about within reach of my slim financial resources. So I moved onto
amplified systems. Just as with the simple crystal sets, I started
with published circuits and then experimented. I had no time for
all the theory, it all seemed too complicated and required all
kinds of arcane computation. But I also thought I could do better
than the published circuits. My development method was largely
based on making semi-random changes (sort of guided by some form of
intuition) to the circuit and then assessing the result. I can
still remember my delight when I managed to pick up the sound part
of the existing BBC TV transmissions.</p>
<p>During the whole of that summer and the following one I do not
remember ever burning out a transistor. On reflection that must
have been a result of outstanding luck. By my mid-teens I was
moving on to some other interest and it wasn't until the late
1970's that I was again going to dabble with electronics. By that
time the cavalier attitude of youth had long gone and the first
time I opened a computer (a Research Machine's 380Z) to fix a
problem it was with considerably more respect for what could go
wrong. I still find myself experimenting but very much constrained
to what I know cannot do any permanent harm.</p>
<p>You may be wondering what all this has to do with programming.
Well look around you and think about the way that so many of your
colleagues write their source code. Very early on in my programming
life (somewhere in the late 60s) I found myself writing carefully
honed assembler. It had to be, because almost all mistakes resulted
in failure. Failure meant hours poring over core dumps etc. trying
to figure out what wasn't working. As I was also pushing the
machine I was using (and IBM 1130 with 8k of 16-bit words) to the
limit of its resources I had to write tight code that ran
efficiently. By contrast with my radio building days I found that I
had to understand what I was doing. There was none of the 'try it
and see' because that way would result in nothing. A failed run
cost me a day's work (well an evening's because daytime was devoted
to teaching the young). Programming at this level taught me that
'almost right' was of no use.</p>
<p>Another feature of programming at assembler level is that
virtually all errors are logic/runtime ones. Though not impossible,
it is relatively hard to produce syntax errors at this level. By
contrast the more complicated syntax of high-level languages means
that new code written by almost any programmer will include syntax
errors. These are usually quickly eliminated (providing that the
compiler manages to generate something approximating a helpful
error message - error messages that give the name-mangled names of
template instantiation syntax errors are rarely helpful, the signal
to noise ration is too low).</p>
<p>Unfortunately the end result of removing syntax errors from your
code is often code that appears to run and do something. Indeed in
my early C-programming days I can remember being puzzled by all the
null-assignment warnings that I was getting at the end of programs
that had run successfully and providing correct output. However
debugging runtime problems all too often seems to come down to
experimentation coupled with building a model of how we think a
program is behaving. This even extends to rationalising the
behaviour to fit our model.</p>
<p>Have you heard the (probably apocryphal) story about a young
Oxford Chemistry graduate in his first job. His supervisor comes in
one day to find him involved in doing a boiling point experiment.
On being asked what he is doing, the graduate explains that he
needs to know the boiling point of nitro-glycerine and he had been
taught to check data experimentally. It had never crossed his mind
that he should look the answer up - that would have been
dishonest.</p>
<p>Curious how rarely programmers look up the answers to their
problems. If an expression doesn't work the way you expect from
prior experience it must be a bug in the compiler.</p>
<p>The low-level nature of crystal sets and simple allowed (indeed
encouraged) an experimental approach while the low-level nature of
assembler actually discourages experiment. Many programmers would
improve their performance if they were less like the chemistry
graduate. If you want to know how your code should work, look it up
in a reference book or a Standard's document. Life is too short to
do it any other way.</p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
