    <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  :: Professionalism in Programming #5</title>
        <link>https://members.accu.org/index.php/articles/1080</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">Professionalism in Programming, from CVu journal + CVu Journal Vol 12, #6 - Dec 2000</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/c182/">Professionalism</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/c123/">126</a>
<br />

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

                    -                        <a href="https://members.accu.org/index.php/articles/c182+123/">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;Professionalism in Programming #5</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 06 December 2000 13:15:41 +00:00 or Wed, 06 December 2000 13:15:41 +00:00</p>
<p><strong>Summary:</strong>&nbsp;<p>Documenting Code</p></p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a>Do we write
code for computers or humans?</h2>
</div>
<p>Well, presumably we write code for 'customers'<sup>[<a name=
"d0e27" href="#ftn.d0e27" id="d0e27">1</a>]</sup>, so we are
hopefully aiming for the latter. My question more specifically is:
do we write code for <span class="emphasis"><em>it to be
read</em></span> by computers or humans?</p>
<p>We certainly write code in order to instruct a computer what to
do. But we are actually writing code to express the concepts in our
heads, to describe the way we want to mould the flow of execution
and how to manipulate the data structures we have generated.</p>
<p>I think it is fair to say that machine code is supposed to be
read by computers - it is the language of the CPU. You cannot talk
to a microchip in English, after all. However, any higher-level
language like C or C++ is removed from the machine code by a number
of levels<sup>[<a name="d0e38" href="#ftn.d0e38" id=
"d0e38">2</a>]</sup>. When we write code in these languages do we
really write for the computer? It is more accurate to say we write
code for both ourselves and the computer.</p>
<p>However, we are writing the code in a more human-friendly way,
primarily for ourselves. We then get a compiler to 'translate' our
human-friendly language into computer-friendly language the CPU can
understand. In this respect, the programming language we choose has
been designed so that we can talk to the machine. But it has been
created mainly so that we can convey our thoughts and concepts in a
natural manner for us.</p>
<p>So then, programming languages are how we express our programs,
both to the author and for the (human) reader. We use programming
languages to prevent ambiguity. We use them as concrete
documentation of the algorithms we choose.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e46" id=
"d0e46"></a>Self-documenting code</h2>
</div>
<p>So if we are writing code for humans to read, we should be
taking care to make the code as clear as possible, and as easy to
understand as possible. By necessity the code is something that
more people than just the author must be able to understand. This
actually is not that hard to do, and takes little effort. By
improving the ease of understanding of the code we write we gain a
number of benefits:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>We are less likely to make mistakes, since errors are more
explicit</p>
</li>
<li>
<p>Maintaining the code is cheaper - it takes less time to 'get
into it'</p>
</li>
</ul>
</div>
<p>Remember that computer programs are inherently much harder to
read than they are to write. Anyone who has used Perl will
understand this. Perl has been described as the ultimate write-once
language. If you come back to some of your old Perl code, or look
at someone else's, you'll be lucky if you are able to understand
it.</p>
<p>It has been argued that the only document that explains some
code completely and correctly is the code itself. This is one of
the Extreme Programmer's axioms [<a href="#BECK">BECK</a>]. It is
certainly true, but it does not necessarily follow that it is best
description possible. Whether you are using that as an excuse
(sorry, reason) not to write a specification or code comments, or
believe that we should still write supporting documentation, it is
clear that we will benefit from writing code that is as
self-documenting as possible.</p>
<p>By 'self-documenting' code, I mean easily readable code that
stands comprehensible on its own. We can improve the clarity of our
code in many ways. Some are very basic and have been drilled into
us since we were taught to program. Others are more subtle and come
with experience. For example:</p>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e67" id="d0e67"></a>Choosing
meaningful names</h3>
</div>
<p>Variable, function and type names, as well as file names should
be meaningful and not misleading. Their name should describe what
they contain or define. If you cannot name something meaningfully
do you really understand what it is doing? Function names describe
what the function does. Because of this they generally begin with a
verb.</p>
<p>It takes a bit of experience to be able to pick the correct
balance of name length vs. readability. Purists argue that you
should not abbreviate the words in your variable names at all. If
we wanted a fight now would be a good time to mention Hungarian
notation.</p>
<p>Back in the days of yore, name choice was harder because
compiler technology limited the number of characters available and
file systems imposed rigid constraints. However, in these
enlightened times, this kind of problem is practically
non-existent, and there is no reasonable excuse for sloppy
naming.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e76" id="d0e76"></a>Choose meaningful
types</h3>
</div>
<p>As far as possible, describe constraints with the available
language features. For example, if you are defining a value that
will never change (either a file-static constant or an intermediate
value of a calculation) enforce it with const. If a variable cannot
have a valid negative value, make its type unsigned. Use enums to
define several related values.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e81" id="d0e81"></a>Provide meaningful
comments</h3>
</div>
<p>Clear code contains an appropriate amount of commenting. It is
actually harder than would first appear to describe exactly what
that 'appropriate' amount is.</p>
<p>Adding comments to code does not really make it
self-documenting. The code and the comments can all to easily get
out of sync. Even so, meaningful comments add much value.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e88" id="d0e88"></a>Name
constants</h3>
</div>
<p>'Magic numbers' are evil. They hide meaning. Writing <tt class=
"literal">10</tt> in the statement <span class="markup">if (10 ==
count)</span> is not very explicit - what are you actually checking
for? Writing <span class="markup">static const size_t
MAX_NO_BANANAS = 10</span>; (or even better, avoid tripping over
the pre-processor by using some lower case letters in that
identifier) and then <span class="markup">if (MAX_NO_BANANAS ==
count)</span> is much clearer. It also has the benefit that if you
use the value <tt class="constant">10</tt>, sorry <tt class=
"varname">MAX_NO_BANANAS</tt>, a lot in your code and you need to
change the definition, you can do it just once at the definition
line, rather than perform an error-prone search for every
<tt class="constant">10</tt> in the project.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e114" id="d0e114"></a>Emphasise
important code</h3>
</div>
<p>When writing your code, take care to make the important stuff
stand out from the mundane stuff. A good example of this would be
the ordering of definitions in a class. The public information
should come first, since this is what the class user needs to see.
Order the private, implementation details last since they are less
important to the reader.</p>
<p>Wherever possible hide all the non-essential information. Use
the Pimple idiom [<a href="#MEYERS">MEYERS</a>] to hide
implementation details.</p>
<p>Also avoid hiding important code. Only put one statement per
line. You can write very clever for loops with all the logic on one
line using commas, but it is not easy to read.</p>
<p>Limit the number of nested conditional statements. The important
handling of conditions becomes hidden by a nest of ifs and
braces.</p>
<p>Do not clutter code with revision history information in
comments when you can get it all from your source management system
(cvs, rcs, sccs etc).</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e130" id="d0e130"></a>Group related
information</h3>
</div>
<p>It is much clearer to present all related information in one
place. The API for a single module should be presented in one file.
If there is so much related information that it becomes messy to
present it together, have you designed correctly?</p>
<p>If at all possible the grouping should be enforced by language
construct. For example, in C++ we can group items within a
namespace. Related values can be defined in an enum.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e137" id="d0e137"></a>Provide a file
header</h3>
</div>
<p>Placing a comment header at the top of a file describing its
contents and the project to which it belongs takes little effort,
but can make a big difference when someone comes to maintain that
file in the future. Even writing the author's name can be
useful.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e142" id="d0e142"></a>Handle errors
gracefully</h3>
</div>
<p>Whatever the error mechanism you are using (which will most
likely be related to the language you are using) you should handle
every possible error condition that can occur. That's just common
sense. But you should also handle errors in their appropriate
context. For example, if there is a disk I/O problem you should
handle it in the code that accesses the disk. Perhaps handling this
error would mean raising a different error (like a 'could not load
file' exception) to a higher level. This means that at each level
in the program an error is an accurate description of what the
problem is.</p>
<p>Self-documenting code helps the reader to understand where an
error came from, and what its implications are for the program.</p>
<p>If your language allows, declare variables at first use, and
initialise them</p>
<p>OK, so you cannot really do this in C<sup>[<a name="d0e153"
href="#ftn.d0e153" id="d0e153">3</a>]</sup>. It is much clearer to
declare any variable as close as possible to its first use. If you
declare it at the top of a function, and first use it &frac34; of
the way down the code looses clarity. Any other programmer who
comes back to your code will see the variable used, but to find out
what type it is they have to scroll all the way back to the
beginning of the function.</p>
<p>If the variable has an important initial value, then it should
be initialised in the declaration to prevent confusion. Initial
values are another reason to declare near first use, by separating
the initial value from its first use you can prevent the reader
from following the code properly.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e159" id="d0e159"></a>Write short
functions</h3>
</div>
<p>They are just so much easier to understand. It is easier to
understand a complex algorithm if it is broken into pieces with
descriptive names then if it is just a sprawling morass of code on
the page.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e164" id="d0e164"></a>Know when to
break the rules</h3>
</div>
<p>The experienced programmer knows when the rules are getting in
the way of doing a proper job. For example, it is important to give
variables meaningful names, but when you have a loop counter for a
single line loop, a variable name n may be greatly preferable to
indexIntoWidgetTable, especially when your code needs to fit into a
certain number of columns per line.</p>
<p>These are some simple ways of writing your code for humans to
read. Please write in with suggestions of other ways to make your
code self-documenting. However, there are some more elaborate
alternatives...</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e171" id="d0e171"></a>Literate
programming</h2>
</div>
<p><span class="emphasis"><em>Literate programming</em></span> is a
term coined by the renowned computer scientist Donald Knuth; he
wrote a book by this title [<a href="#KNUTH">KNUTH</a>] describing
it. In many ways it is a quite radical alternative to the
traditional programming model, although some think that the
literate programming episode of Knuth's career was a large and
unfortunate sidetrack. Even if it is not the <span class=
"bold"><b>One True Way</b></span> to code, it does not mean that
there is nothing we can learn from the concept.</p>
<p>The idea of literate programming is simple; not only is the
source code written for humans to read, it is embodied in the
system documentation. The documentation language is bound up
tightly with the programming language. You write one file that is
primarily a description of what is being programmed, but also
happens to compile into it. The source code is the
documentation.</p>
<p>It is almost written as a story, it is easy for the human reader
to follow (perhaps even enjoyable to read). It is not ordered or
constrained in any way to make it easy for the computer to parse.
This is more than just a language with inverted comments! It is
hard to describe when we think in our traditional file-based
programming paradigm, literate programming is a whole different way
of thinking about programming.</p>
<p>Knuth originally mixed T<sub>E</sub>X (a document typesetting
mark-up language) and C in a system called WEB. A literate
programming tool parses the source file, and generates either
formatted documentation (printable or HTML, for example) or source
code that can be fed to a traditional compiler.</p>
<p>Of course, since this is just another programming technique,
like structured programming or object oriented programming, it
still does not guarantee quality documentation. That is, as ever,
up the programmer. However the technique shifts emphasis onto
writing a description of the program rather than just writing code
that implements it.</p>
<p>Literate programming tends towards keeping the documentation
consistently accurate - it is updated with code, since it is right
beside the code. Many programmers will tell you from first hand
experience how easy it is to forget to update a separate
specification when you modify some code.</p>
<p>Literate programming also encourages the inclusion of items not
normally found in source comments, for example a description of
algorithms used, proofs of correctness, and justification for
design decisions. This sort of documentation can be included
without cluttering source with random comments or bogging down a
specification with many issues about specific bits of code.</p>
<p>During the maintenance phase of a product literate programming
really comes into it own. With good quality (and quantity)
documentation directly on hand it is much easier and cheaper to
maintain the source.</p>
<p>Some literate programming tools can include pictures and charts
in the source. They allow you to do clever things like describe a
C++ class in its entirety (i.e. both interface documentation and
implementation documentation) in one source file, and have the tool
split it out into the <tt class="literal">.h</tt> and <tt class=
"literal">.cpp</tt> files for you.</p>
<p>In the third article in this series [<a href=
"#GOODLIFFE">GOODLIFFE</a>] we discussed software specifications.
So how does literate programming relate to specifications? A
literate program will never replace a functional specification
describing what work needs to be done. However, it may be possible
to develop a literate program from such a specification. The
literate program really is more of a combination of the traditional
code with the design and implementation specification. See
[<a href="#MALL">MALL</a>] for more information on literate
programming.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e217" id="d0e217"></a>Documentation
tools</h2>
</div>
<p>There is a breed of programming tool that is a sort of halfway
house between writing separate specifications and the literate
programming approach. They are greatly gaining popularity. These
are tools that generate documentation from your source code. The
documentation is pulled out from blocks of specially formatted
comments that you write. This has perhaps been particularly
fashionable since Sun introduced the <span class=
"productname">Javadoc</span>&trade; program [<a href=
"#SUN">SUN</a>] as a core component of the Java platform. All of
the Java API documentation is created automatically by <span class=
"productname">Javadoc</span>&trade;.</p>
<p>For example, to document a <tt class="classname">Widget</tt>
class, you would write something like:</p>
<pre class="programlisting">
/**
* This is the documentation for the Widget
* class. The tool knows this because the
* comment started with the special '/**'
* identifier.
* @author Author name here
* @version Version number here */

class Widget {
public:
/** * This is the documentation for a method. */
void method(); };
</pre>
<p>A documentation tool will parse the file, and extract the
documentation information, building a cross-referenced database of
all the information it finds on the way. Then it will spit out a
document (either online or hard copy) containing this information.
This is most likely API documentation rather than implementation
documentation.</p>
<p>There are a number of such tools available today. Many of them
are open source and widely used. I list below a number of them and
provide a simple comparison of features (E&amp;OE!). I have never
used any commercial documentation packages - the free ones are so
good I would like to know what the commercial offerings provide
(apart from fancy GUI front-ends). If any readers have experience
with them then I would be glad to hear about it.</p>
<p>It is worth noting that most of these tools do not support Java
since the language already comes with a de facto tool.</p>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e244" id="d0e244"></a><span class=
"productname">Doc++</span>&trade;</h3>
</div>
<p>Available from: <a href="www.linuxsupportline.com/~doc++/"
target="_top">www.linuxsupportline.com/~doc++/</a></p>
<p>This is a widely used tool. It creates well-structured
documentation with good cross-referencing and automatic class graph
generation. However, these graphs come in the form of unwieldy Java
applets for HTML output. The documentation is not the most elegant
to look at since it is quite spread out. The special comment syntax
is not completely consistent which makes it a bit odd to read in
the source file. The tool provides a good range of special fields
(for example, the <tt class="literal">@author</tt> tag).</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e257" id="d0e257"></a><span class=
"productname">CcDoc</span>&trade;</h3>
</div>
<p>Available from: <a href="www.joelinoff.com/ccdoc/" target=
"_top">www.joelinoff.com/ccdoc/</a></p>
<p><span class="productname">CcDoc</span>&trade; is designed to be
a <span class="productname">Javadoc</span>&trade; for C++. Its
comments are quite like the Javadoc syntax, but not quite. It has a
shareware licence, but has open sources. It costs $20.00 per copy.
The output is just like <span class=
"productname">Javadoc</span>&trade; from the 1.0.2 JDK days and
looks a bit dated.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e275" id="d0e275"></a><span class=
"productname">Doxygen</span>&trade;</h3>
</div>
<p>Available from: <a href="www.stack.nl/~dimitri/doxygen/" target=
"_top">www.stack.nl/~dimitri/doxygen/</a></p>
<p><span class="productname">Doxygen</span>&trade; is a very nice
program. It produces really cute output with good
cross-referencing. The pages have nice class diagrams at the top,
which unlike <span class="productname">Doc++</span>&trade; are not
Java applets. <span class="productname">Doxygen</span>&trade; is
also very flexible - it can accept a number of different comment
styles, including Javadoc style, Qt style and a one-line style.
Output is similarly customisable.</p>
<p>Doxygen comes with a GUI front-end (written using the Qt
library) too. It is a powerful tool.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e295" id="d0e295"></a><span class=
"productname">Cocoon</span>&trade;</h3>
</div>
<p>Available from: <a href="www.stratasys.com/software/cocoon/"
target="_top">www.stratasys.com/software/coccon/</a></p>
<p><span class="productname">Cocoon</span>&trade;'s output can be
'flavoured', but is fairly lumpy to look at. Its HTML uses frames,
but is not particularly elegant. The comment syntax is also a bit
curious, and the program requires that you put the keywords class,
private, protected and public in first text column. <span class=
"productname">Cocoon</span>&trade; does not support any extra
information tags.</p>
<p>The <span class="productname">Cocoon</span>&trade; licence is
freeware. The author explicitly states that it is not open source,
but you can download the source code and build it yourself.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e315" id="d0e315"></a><span class=
"productname">KDOC 2</span>&trade;</h3>
</div>
<p>Available from: <a href="www.ph.unimelb.edu.au/~ssk/kde/kdoc/"
target="_top">www.ph.unimelb.edu.au/~ssk/kde/kdoc/</a></p>
<p>This is easily my favourite documentation tool. It was written
specifically for the purpose of documenting the <span class=
"productname">KDE</span>&trade; libraries. Classes can be grouped
into libraries and very easily cross-referenced (a very useful
facility). It supports <span class="productname">Qt</span>&trade;
signals and slots [<a href="#TROLLTECH">TROLLTECH</a>] - none of
the other tools do. It is also very easy to use.</p>
<p><span class="productname">KDOC 2</span>&trade; is the most
stable tool I have found, and the output is (in my opinion) the
nicest - as the author puts it, it does not generate 'too much
extraneous fluff'. It is written in Perl and so should work on
Windows as well as Unix.</p>
<p>If you intend to document a project using a tool such as these
then it is advisable to do so right from the very start. It can be
a lot of work to put good quality documentation into an existent
code base. I would suggest looking at either <span class=
"productname">Doxygen</span>&trade; or <span class=
"productname">KDOC 2</span>&trade;.</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;thead&gt;
<tr>
<th rowspan="2">Name</th>
<th colspan="3" align="center">Languages</th>
<th colspan="2" align="center">Generates</th>
<th colspan="2" align="center">Platform</th>
<th rowspan="2">Licence</th>
<th rowspan="2">Output Quality</th>
</tr>
<tr>
<th>C</th>
<th>C++</th>
<th>IDL</th>
<th>On-line</th>
<th>Printable</th>
<th>Unix</th>
<th>Windows</th>
</tr>
&lt;/thead&gt;
&lt;tbody&gt;
<tr>
<td>Doc++</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>HTML</td>
<td>T<sub>E</sub>X</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>GNU GPL</td>
<td>OK</td>
</tr>
<tr>
<td>CcDoc</td>
<td>&#10003;</td>
<td> </td>
<td> </td>
<td>HTML</td>
<td> </td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>Shareware</td>
<td>OK</td>
</tr>
<tr>
<td>Doxygen</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>HTML PDF man</td>
<td>L<sup>A</sup>T<sub>E</sub>X, RTF</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>GNU GPL</td>
<td>Very good</td>
</tr>
<tr>
<td>Cocoon</td>
<td>&#10003;</td>
<td> </td>
<td> </td>
<td>HTML</td>
<td> </td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>Freeware</td>
<td>Naff</td>
</tr>
<tr>
<td>KDOC 2</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>HTML man</td>
<td>L<sup>A</sup>T<sub>E</sub>X Texinfo DocBook</td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>GNU GPL</td>
<td>Very good</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e508" id=
"d0e508"></a>Conclusion</h2>
</div>
<p>Writing code is not just about typing fors and switches into a
text file. And it is not all about the high level design, either. A
good programmer who takes pride in their professionalism is careful
to write code that can be easily read, aiming for it to be
self-documenting code. We write code primarily to communicate.</p>
<p>Literate programming is one (quite extreme) method of writing
self-documenting code. Another less extreme method involves using
documentation tools. These tools can generate API documentation
very easily, but they do not necessarily take the place of a
well-written specification or other descriptive document.</p>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e515" id="d0e515"></a>References</h2>
</div>
<div class="bibliomixed"><a name="BECK" id="BECK"></a>
<p class="bibliomixed">[BECK] Kent Beck. <span class=
"citetitle"><i class="citetitle">Extreme Programming
Explained</i></span>. Addison Wesley Longman. (0 201 6164 1).</p>
</div>
<div class="bibliomixed"><a name="MEYERS" id="MEYERS"></a>
<p class="bibliomixed">[MEYERS] Scott Meyers. <span class=
"citetitle"><i class="citetitle">Effective C++</i></span>. Item 34:
Minimize complication dependancies between files. Addison Wesley
Longman. (0 201 92488 9).</p>
</div>
<div class="bibliomixed"><a name="KNUTH" id="KNUTH"></a>
<p class="bibliomixed">[KNUTH] Donald Kunth. Literate Programming.
University of Chicago Press. (0 93707 380 6).</p>
</div>
<div class="bibliomixed"><a name="GOODLIFFE" id="GOODLIFFE"></a>
<p class="bibliomixed">[GOODLIFFE] Pete Goodliffe. <span class=
"citetitle"><i class="citetitle">Professionalism in Programming #3:
Being Specific</i></span>. C Vu, Volume 12 No 4. (1354-3164).</p>
</div>
<div class="bibliomixed"><a name="MALL" id="MALL"></a>
<p class="bibliomixed">[MALL] Daniel Mall. <span class=
"citetitle"><i class="citetitle">Literate Programming
Homepage</i></span>. <span class="bibliomisc">URL: <a href=
"www.literateprogramming.com" target=
"_top">www.literateprogramming.com</a></span>.</p>
</div>
<div class="bibliomixed"><a name="SUN" id="SUN"></a>
<p class="bibliomixed">[SUN] Sun Microsystems, Inc. Javadoc Tool
Homepage. <span class="bibliomisc">URL: <a href=
"java.sun.com/products/jdk/javadoc/" target=
"_top">java.sun.com/products/jdk/javadoc/</a></span>.</p>
</div>
<div class="bibliomixed"><a name="TROLLTECH" id="TROLLTECH"></a>
<p class="bibliomixed">[TROLLTECH] Trolltech A.S. Qt library.
<span class="bibliomisc">URL: <a href=
"www.trolltech.com/products/qt.qt.html" target=
"_top">www.trolltech.com/products/qt.qt.html</a></span>.</p>
</div>
</div>
<div class="footnotes"><br>
<hr class="c3" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e27" href="#d0e27" id=
"ftn.d0e27">1</a>]</sup> Or just plain users, if it is a freeware
or open source project.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e38" href="#d0e38" id=
"ftn.d0e38">2</a>]</sup> This level may be different for C compared
to C++; many people see C as a kind of 'portable' assembler.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e153" href="#d0e153" id=
"ftn.d0e153">3</a>]</sup> Well, actually you can with judicious use
of braces.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
