    <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  :: Francis' Scribbles</title>
        <link>https://members.accu.org/index.php/articles/850</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>




<div class="xar-mod-head"><span class="xar-mod-title">Francis' Scribbles from CVu journal + CVu Journal Vol 17, #6 - Dec 2005</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/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c184/">Journal Columns</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c181/">Francis' Scribbles</a>
<br />

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

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

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

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c93/">176</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c181-93/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c181+93/">All of these categories</a>
<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;Francis' Scribbles</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 07 December 2005 05:00:00 +00:00 or Wed, 07 December 2005 05:00:00 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e26" id="d0e26"></a>Safety Critical
Programming &amp; C++</h2>
</div>
<p>Scott Meyers recently posted a request to <tt class=
"literal">comp.lang.c++.moderated</tt> for information about any
current uses of C++ in safety critical programming. I am not going
to report on the resulting thread other than to say that there is
one EC++ (embedded C++) compiler (DO-178B Level A certifiable
Embedded C++ (EC++) for its safety-critical INTEGRITY 178B RTOS)
that meets pretty stringent requirements for use in a specific
environment. It will come as no surprise that this compiler is
based on the EDG front end coupled with the Dinkumware EC++
Library.</p>
<p>The language used for safety critical programming worries me far
less than the human beings using it. This is the issue that I want
to address here.</p>
<p>If you want to work in the UK on gas (note that this is not
'gas' in the US sense of the word) central heating systems you
cannot legally do so without certification. Going out and buying a
fist class set of professional tools that meet the BSI standards
for use with gas appliances does not even start to turn you into a
gas central heating engineer, nor should it.</p>
<p>Joining a professional body for plumbers is not enough either.
You need competence as a plumber to deal with a central heating
system, however you need something more before you are legally
allowed to touch a customer's gas appliances; you must be CORGI
registered (for more information see <a href=
"http://www.corgi-gas-safety.com/section_about/%20corgi_council.asp"
target="_top">http://www.corgi-gas-safety.com/section_about/
corgi_council.asp</a>). I have no doubt that there are many people
who are competent to work on gas central heating systems who are
not CORGI registered, however these people cannot legally do any
work on such a system. Any professional (as opposed to cowboy,
fly-by-night) plumber would know what the limits were on his work;
no CORGI registration, no touching gas appliances.</p>
<p>Notice that there is no requirement that those designing gas
appliances be registered or even have any professional
qualification. Their designs will have to be tested according to
the standards laid down by their National Body.</p>
<p>Who writes those Standards? People who jointly understand
various safety aspects of using gas. It would be entirely
coincidental if any of those people were CORGI registered. The
collective knowledge of the committee writing a standard is
important and so such a committee would benefit from being widely
based.</p>
<p>Now start applying the same ideas to programming safety critical
systems.</p>
<p>I find it disturbing that we do not yet have an adequate form of
certification that covers both the basics of programming safely and
requires endorsement for specific computer languages.</p>
<p>Having a certified EC++ compiler for a specific RTOS is great
but that in itself is only a very small part of the problem. The
human beings in the mix cause the problems. They (as a team) need a
full understanding of the problem domain and the tools they are
using.</p>
<p>Using some set of coding guidelines such as MISRA C does not
turn an ordinary programmer into one that can be allowed to deal
with issues where human life is at risk. I contend that anyone who
believes that the following code is safe and guaranteed to output 5
is not qualified to write guidelines for use of C in safety
critical contexts.</p>
<pre class="programlisting">
#include &lt;stdio.h&gt;
int main(){
  int i = 2;
  int j = (i++) + (i++); /* A */
  printf(&quot;%d&quot;, j);
  return 0;
}
</pre>
<p>A full understanding of C is certainly achievable and anyone
working on safety critical C code should have that level of
understanding as a pre-requisite.</p>
<p>We need development tools that work as described and generate
correct code from our correctly written source code. We need
guidelines (preferably ones with tools to enforce them) to avoid
problems caused by implicit problems in the language being used.
Above all, we need programmers (software engineers if you insist on
being grandiose) who fully understand what they are doing and what
their code means. A competent programmer will never confuse
undefined behaviour with unspecified behaviour.</p>
<p>We need guidelines that prohibit code such as that in line A in
the above. However, we also need the programmer to understand why
such code is forbidden and that no number of parentheses will fix
it.</p>
<p>We also need programmers who do not think that testing will
demonstrate that code is safe. All that testing will do is detect
some faults, it will not prove that the code is fault free.</p>
<p>I do not need a professional qualification to understand these
issues, nor do you. Yet it seems that quite a few people with
professional qualifications do not understand them. At that point,
it is fair to ask what the value of a professional qualification
is.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e67" id="d0e67"></a>Fragile
Validation</h2>
</div>
<p>I recently purchased a download version of ZipMagic 9.0. My
experience highlights a serious weakness with such purchases and
validation.</p>
<p>In order to install the application I have to type in the serial
number. Unfortunately despite having been supplied with three
different serial numbers, none of them allow me to install the
product.</p>
<p>What is worse is that the supplier (Allume) has failed to
respond to my emails. Sales decided it was not their problem and
Technical support seem to have nothing to say after I supplied them
with the information they asked for.</p>
<p>I wonder how many readers have had similar problems with either
this product or other ones.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e78" id="d0e78"></a>Problem 23</h2>
</div>
<p>Problems with initialisation have been of concern to those
responsible for working on the next version of the C++ Standard.
Have a look at the following code and comment on any possible
surprises.</p>
<pre class="programlisting">
#include &lt;iostream&gt;
struct X {
  int i;
  X(){}
};
struct Y: struct X{
  int j;
  Y(): X(), j() {}
};
Y y = Y();
int main(){
  std::cout &lt;&lt; y.i &lt;&lt; std::endl;
  return 1;
}
</pre>
<p>Note that there is more than one problem with the above
code.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e87" id="d0e87"></a>Problem 22
Revisited</h2>
</div>
<p>Well the problem is that I have run out of a ready supply of
little coding surprises and problems. It is time that you got
involved. Please send in at least one coding surprise. If you do
not have any then I guess you do not actually do much
programming.</p>
<p>The surprise can be in any of the programming languages that are
used regularly for application programming (C, C++, C#, Java,
Python etc.)</p>
<p>I wrote the above in my last column. Sadly, there has been no
response. I cannot believe that none of you has anything to offer
so perhaps you just think yours is too trivial for consideration.
In my experience, there are no trivial programming surprises.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e96" id="d0e96"></a>Cryptic Clues
for Numbers</h2>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e99" id="d0e99"></a>Last Issue's
Clue</h3>
</div>
<p><span class="emphasis"><em>One for love too? Sounds like the
right day for it!</em></span></p>
<p>I thought that one was easy; perhaps the problem was coming up
with an alternative clue. 14/02 is Valentines Day (love usually
clues a zero, or in cryptic crosswords it clues the letter o.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e107" id="d0e107"></a>This Issue's
Clue</h3>
</div>
<p><span class="emphasis"><em>Help! Looks like a sailing dinghy.
Hawaiian police series number 5. (3 digits)</em></span></p>
<p>As always, decide what number is provided by the above clue and
then come up with an alternative clue. Email your clue to me at the
address below.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
