    <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  :: From the Coalface</title>
        <link>https://members.accu.org/index.php/journals/738</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 10, #6 - Sep 1998</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/c135/">106</a>
                    (12)
<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;From the Coalface</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 September 1998 13:15:27 +01:00 or Thu, 03 September 1998 13:15:27 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="section" lang="en">
<div class="titlepage">
<h2><a name="d0e18" id="d0e18"></a></h2>
<h3>I have a friend... another Tale From the
Linker.</h3>
</div>
<p>My friend may have synthesised his story from one or more
incidents at different times and places. On the other hand he may
not have.</p>
<p>My friend told me of a curious series of incidents that happened
over the last week or so on his project. All the source code for a
project was being reviewed. Everyone agreed that code inspections
or walk-throughs are a 'Good Idea'&trade;. How ever it transpired
that this was in the same vein as winning the lottery is a Good
Idea. Doing it was another matter.</p>
<p>There were three teams on the project. One doing a core and the
other two doing applications that would use the core. As one of the
engineers doing the core has had 12 months more experience (on one
of the application fields) than the rest he was made the System
Design Authority. However his general SW engineering experience was
a lot less than the rest of the engineers.</p>
<p>The code reviews were done. One engineer from each application
team attended their own code review (and took the notes) With the
system design person. A person from the core team (because the app
would have to interface to it) and occasionally a contractor who
had worked on the target before who was working on the core.</p>
<p>The same scenario was used for the core reviews. This meant that
the core was only reviewed by those who had written it! There were
no reviewers from the applications. For reasons of time and staff
availability some reviews had only two people present.</p>
<p>This produced some interesting results. There were many comments
from the application review where the core team had no prior
knowledge like &quot;What is ABC1?&quot; ABC1 is a term used through out the
SW and documentation including the glossary for the particular
application. I.e. it is like a looking at comms SW for a PC and
wanting COM1 explained everywhere it appears in the source
code&hellip; If you do not know what a COM port it perhaps you
should read the documentation before adjusting the code?</p>
<p>However on the application where the core team did have prior
knowledge it was not felt necessary to explain any acronym no
matter where it appeared because &quot;everyone knew what it meant!&quot; One
engineer did raise this when he saw some unexplained names in the
code of a fellow team member but the Team Leader said &quot;I know what
that is... no need for a comment.&quot;</p>
<p>Now this brought about some interesting actions. The Core review
went well with very few comments. One application had a few more
but, strangely, in the application where the core team had no
understanding there were a lot of comments.</p>
<p>Enter the Project Manager. My friend as the lead on the
application with the most comments was called in to explain the
problem.</p>
<div class="variablelist">
<dl>
<dt><span class="term">Project Manager:</span></dt>
<dd>
<p>&quot;So why is your code of such poor quality?&quot;</p>
</dd>
<dt><span class="term">Engineer:</span></dt>
<dd>
<p>&quot;It's not, the reviewers were asking silly questions. Remove
those and the number of comments is similar to the other two
reviews. Look, I have one of the files from one of the other
groups. If I ask what's this, and this and... well do you know what
that is?&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;No.&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;So we are up to 9 comments for this function. Their review only
had 3 and we haven't even started on some of the dodgy code
constructs used.&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;Er... Well... This is all irrelevant. We are here to see why
your code is so bad.&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;Well all my code compiles, links and has no warnings on lint. I
can see one item in the core code there that lint will not let
through at all.&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;I don't care about compilers and lint. We are trying to find
why your code is such poor quality!&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;So the fact that my code links and lint's clean and the core
code will not even compile is not relevant.&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;Yes because you have a lot more review comments. You're doing a
lot of wrong things as well... look at all this.&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;You mean initialising the variables where they are declared for
safety so there is no chance that they can be used before
initialisation?&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;Oh is that what it is? Well I can't see any point. The core
team have not done that. It wastes space.&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;How so?&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;If the this code does a return at the first data check you have
wasted time and space setting up all those variables that will not
be used because they are not needed till later in the function.
Besides it's OK doing that for the variables but you can't do that
for pointers can you?&quot;</p>
</dd>
<dt><span class="term">Eng:</span></dt>
<dd>
<p>&quot;Well I just initialise those to NULL&quot;</p>
</dd>
<dt><span class="term">PM:</span></dt>
<dd>
<p>&quot;What's NULL?&quot;</p>
</dd>
</dl>
</div>
<p>My friend called me that evening and mentioned the above so I
called someone I know who had some dealings with the new MISRA
Embedded C Guidelines for automotive SW. Apparently one of the
mandatory rules does require initialisation of automatic variables
before use and suggests doing it at declaration.</p>
<p>NOTE: MISRA is the SW arm of the MIRA who do all the independent
car testing. If you are doing any embedded work I can recommend
getting hold of the standard. At &pound;25 you have no excuse. It
actually makes good sense for any C programming not just embedded
or safety critical. You can get the standard from David Ward:
<tt class="email">&lt;<a href=
"mailto:david.ward@mira.co.uk">david.ward@mira.co.uk</a>&gt;</tt>
or 01203 355430</p>
<p>My friend renewed with the knowledge that he was not loosing his
sanity went back to the project leader to say &quot;Not only is this not
bad practice it is mandated good practice. There is an embedded C
standard that says so!&quot; The reply was &quot;I'm not interested in
standards I have a project to get out...&quot; My friend persevered and
again argued that in fact the SW was not of poor quality but to no
avail. It must be poor quality as it got more review comments than
the core. So my friend took the same function from the core code as
had been looked at previously and found several dubious bits of C
(without even resorting to lint) however he was told that this was
just being picky as the SW worked...</p>
<p>Foot note: When the core code was first compiled for a build it
took 2 days to get it to compile and link. Both the applications
(using their own stubs for the core) had been able to compile and
link at all times during development despite being of &quot;poor
quality&quot;.</p>
<p class="c3"><span class="remark">What is really disturbing about
this tale is that the company is a household name and one where you
would expect better than average management. There is also the two
serious breeches of code inspection rules: code inspections are for
code (and coding) improvement and not to assign blame, code reviews
must not be done by the owners of the code (though they should have
a representative present).</span></p>
<p class="c3"><span class="remark">I have a simple question, but
one that I suspect cannot be answered. How should we handle such
situations? Note that the core code group were far from
innocent.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
