    <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 #7</title>
        <link>https://members.accu.org/index.php/articles/1111</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 13, #2 - Apr 2001</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/c121/">132</a>
<br />

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

                    -                        <a href="https://members.accu.org/index.php/articles/c182+121/">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 #7</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 06 April 2001 13:15:45 +01:00 or Fri, 06 April 2001 13:15:45 +01:00</p>
<p><strong>Summary:</strong>&nbsp;<p>Practicing safe source</p></p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id=
"d0e22"></a>Responsibility</h2>
</div>
<p>As 'professional' programmers we have a duty to take
responsibility for our work. This is to guarantee the quality,
safety and maintainability of our code. In this column we are going
to think not so much about the safety of our <span class=
"emphasis"><em>executables</em></span> as that of our <span class=
"emphasis"><em>development processes</em></span>.</p>
<p>Even though we are programmers we have the responsibility to
ensure that our work is:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p><span class="bold"><b>safe and secure</b></span> (i.e. it will
not be accidentally lost after three months of development and
cannot be leaked as trade secret information out of the
company),</p>
</li>
<li>
<p><span class="bold"><b>accessible</b></span> (i.e. modifiable by
the appropriate people, not by others),</p>
</li>
<li>
<p><span class="bold"><b>reproducable</b></span> (once released,
the source is not thrown away and can still be used to build
exactly the same application image 16 years later when the tool
versions have changed and its language is not supported any more),
and</p>
</li>
<li>
<p><span class="bold"><b>maintainable</b></span> (this does not
just include good programming practices, but also the use of
'configuration management' and source control).</p>
</li>
</ul>
</div>
<p>We will touch on these issues below. What we need to bear in
mind is that we have a responsibility to ensure that these
requirements are <span class="emphasis"><em>met</em></span>, not
necessarily to meet them entirely ourselves. Maybe these issues
seem tediously removed from the act of writing code, but we should
not belittle their importance.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e61" id="d0e61"></a>Back ups</h2>
</div>
<p>So this is obvious is it not? We are all well aware that we are
stupid if we do not make regular back ups of our work. But we are
human; if we rely on doing it manually then we will just forget or
leave it too late, or... I am frightened when I discover how much
work gets done on computer systems and workstations that are not
being backed up<sup>[<a name="d0e66" href="#ftn.d0e66" id=
"d0e66">1</a>]</sup>. The level of risk is preposterous.</p>
<p>Now, I am not advocating that the professional programmer should
make a daily personal back up copy of their hard drive. Rather,
that their responsibility lies in ensuring that important files are
placed on a file system that is being backed up. In fact, it is
often best that the responsibility for performing the backups rests
with someone specific, usually the IT department of a company - it
is more likely to get done. After all, it seems that most good
programmers have little or no common sense, let alone memory.</p>
<p>There is not a great deal of difference between the requirements
for personal or corporate backups. The only real difference is the
scale. Back ups need to be:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>regular,</p>
</li>
<li>
<p>checked and audited,</p>
</li>
<li>
<p>easily retrievable, and</p>
</li>
<li>
<p>preferably automatic.</p>
</li>
</ul>
</div>
<p>For example, even when working on an un-backed up NT workstation
I often save my work on an NFS-mounted Unix file server which is
backed up rather than on the unsafe local disk.</p>
<p>There is a whole realm of technical detail involved with making
back ups that we are not able to go into in depth in this article.
For example, in multi-user environments <span class=
"emphasis"><em>when</em></span> are the back ups made? (The answer
is usually during the night when there is less computer activity
and less information changing on the file systems being backed up).
We should also note the differences between 'full' and
'incremental' back ups - the former being a complete physical copy
of a filesystem, the latter a report of the differences between the
filesystem now and how it looked at the last back up. There are
various benefits and costs of each approach - a mixed approach is
usually best.</p>
<p>The main point we should bear in mind is that our work is not
<span class="emphasis"><em>safe</em></span> if it is not
retrievable in the event of human or mechanical failure. Is all
your work backed up? If not then I urge you to remedy this now,
even if it is 'only' for personal use.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e99" id="d0e99"></a>Source
control</h2>
</div>
<p>It is one thing ensuring that your source code is obtainable in
the event of failure. But how accessible is it - can other
developers in your company use it? Perhaps you could work on a
shared file server so others can see your source files too, maybe
even work on them alongside you. But how ideal is this? How do you
make sure two people are not working on the exact same file at the
same time causing all sorts of confusion when they each hit the
&quot;save&quot; button? A better way of managing the code is to use a
<span class="emphasis"><em>source control</em></span> tool.</p>
<p>So what is source control? Well, it is a method for one or many
people to work on the same 'repository' of source code in a
controlled manner. What is does 'controlled' mean? Let us think
about some of the problems that can be faced if people were to work
on the same repository of code (on a shared disk on a common file
server, as in the example above).</p>
<p>There are a number of potential problems:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Altering same file at the same time.</p>
</li>
<li>
<p>Performing a build whilst files are being edited, or even
performing two conflicting builds together.</p>
</li>
<li>
<p>Not saving files, leaving them open in the editor whilst they
are in an inconsistent state on the disk.</p>
</li>
<li>
<p>Releasing a build of the system when the files are still being
worked on, having new features added</p>
</li>
</ol>
</div>
<p>A source control system works around these kinds of problems. It
allows each developer to 'check out' their own copy of the common
source repository and work on that in isolation, whilst enabling
them to keep up to date with all the changes that are being made by
the other users - bringing their copy up to date as and when
required. Any changes that have been made can be 'checked back in'
to the main repository for all developers to see. The source
control tool also allows us to control which users have access to
which parts of the code base, the system administrator will have
the privilege to set this up<sup>[<a name="d0e126" href=
"#ftn.d0e126" id="d0e126">2</a>]</sup>.</p>
<p>Some systems do not allow two users to edit the same file at the
same time (using a kind of locking mechanism), alleviating the
problem (1) above. The more sophisticated systems allow users to
edit the same files concurrently, the changes are merged back
together as they are 'checked back in'.</p>
<p>The repository will contain important revision information that
allows you to check out any version of each file. Therefore you can
make changes in the knowledge that it can be fully backed out of.
This is a very powerful weapon indeed. The repository is a log of
all changes made means that you also get extra benefits:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>You can undo any change that you make, to any level.</p>
</li>
<li>
<p>You can track changes made to the source as you are working on
it.</p>
</li>
<li>
<p>You can see who changed what and when they did it (and can even
do complex searches like see how much work a single developer has
done on a particular product - useful when a product's lifetime is
many years).</p>
</li>
<li>
<p>You can mark a particular revision (release) of a particular
product so that it can be retrieved at any time (useful if your
customer reports a bug in a three year old version of your product
and you need to look at its source code quickly).</p>
</li>
<li>
<p>You can check out a version of the repository as it stood at
some particular date.</p>
</li>
<li>
<p>Allows you to separate 'bleeding edge' code from stable code via
named release points (fixing points (2) and (4) above.</p>
</li>
<li>
<p>... and so on ...</p>
</li>
</ul>
</div>
<p>The main repository can be held on a local machine (I tend to
work like this for small pieces of personal work not destined for
main company repository) or on a remote machine, accessed over a
network connection. Indeed, good source control systems allow
repositories to be accessed within a local network or by developers
world-wide. In the latter case they can be <span class=
"emphasis"><em>very</em></span> useful indeed, removing the burden
of developers in different time zones needing to co-ordinate when
they update files. (In fact, I have recently worked like this on a
project with half of a development team in the UK and half in the
US - and the UK developers split over two sites).</p>
<p>If you are using an important company repository it will be held
on a server that is being backed up. This means that there is less
of a reliance on personal workstation back ups - most of the work
you have done is checked in, and the loss of your workstation will
not be so critical to the project as a whole.</p>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e163" id="d0e163"></a>Working with the
repository</h3>
</div>
<p>There are a couple of different ways of working with a source
code repository. The 'little and often' approach sees each file
checked in when any small change is made. The repository therefore
contains many, many revisions of each file each consisting of a
very small change. Doing this makes it easy to track changes made
during development. The alternative approach is to only check in
the big important changes, i.e. check a version in for each release
of the product. This makes it easier to obtain a particular
previous version of the product, but much harder to track
changes.</p>
<p>I favour the little and often approach, although in many ways
the choice may depend on the quality of the source control tool
used. Usually a repository will have a mechanism to allow you to
mark each major milestone (e.g. CVS' tags) so the little and often
approach in no way lacks the capabilities of its counterpart.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e170" id="d0e170"></a>What source
control tools are there?</h3>
</div>
<p>There are a number of different source control systems
available, some have an open licence, some are proprietary. Each
has its own advantages, each its disadvantages. Often, the choice
of system is enforced by company practice. Sadly, this does not
always mean it is the right tool for the job.</p>
<p>The father of all version control systems was SCCS (the Source
Code Control System) developed at Bell Labs in 1972. I have used
this system at a place of work, and by modern standards it is fair
to say that it sucks. It has largely been superseded by RCS (the
Revision Control System) [<a href="#RCS">RCS</a>]. The most
commonly used source control tool in the open source world is CVS
[<a href="#CVS">CVS</a>]. It is built upon RCS, and provides a
collaborative environment where several developers can work on the
same file at the same time. Whereas RCS uses file locking, CVS is a
concurrent system. Any conflicts in check-ins are marshalled by the
CVS repository. CVS can work across the internet, and is a very
powerful tool. In itself it is a command line program, but there
are a number of different front ends available for any conceivable
platform - take WinCVS/MacCVS (a windows front end) [<a href=
"#CVSgui">CVSgui</a>], Cervisia (a Unix/KDE front end) [<a href=
"#Cervisia">Cervisia</a>], and webcvs (a web based interface to
CVS) [<a href="#cvsweb">cvsweb</a>] as examples.</p>
<p>There are a huge number of proprietary source control tools that
provide different/better<sup>[<a name="d0e194" href="#ftn.d0e194"
id="d0e194">3</a>]</sup> functionality to the free tools available.
These include MKS Source Integrity [<a href="#MKS">MKS</a>], Visual
SourceSafe [<a href="#Microsoft">Microsoft</a>], and PVCS [<a href=
"#Merant">Merant</a>]. Interfaces for both the proprietary and free
source control tools can be embedded in the popular IDEs. Although
such graphical front ends exist, personally I prefer the raw power
and customisability of the command line. Your tastes and/or company
policy may dictate which tool you use and in which environment.</p>
<p>If you are looking for a source control tool to begin to use on
private projects, I would strongly advise you to take a look at
CVS, and one of the available front ends.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e209" id="d0e209"></a>Configuration
management</h2>
</div>
<p>Most source control systems also serve as <span class=
"emphasis"><em>configuration management</em></span> tools. Allowing
you to generate multiple 'products' from single repositories of
source code. They manage the configuration issues, i.e. which files
are included in which product, which versions of these files, what
sort of compilation environment<sup>[<a name="d0e217" href=
"#ftn.d0e217" id="d0e217">4</a>]</sup> is required, which
documentation relates to which product variants, etc. Some
configuration management systems also integrate bug tracking and
work flow control in their system.</p>
<p>In some senses the term configuration management describes how a
source control tool is used during the entire software development
process. It is subtly different from pure 'source control',
encompassing it and adding a development procedure to its use.
However, some tools provide more configuration management
capabilities than others.</p>
<p>Using configuration management we would store more than just
source code and object code for which have no source (e.g. from
external suppliers). We would include specifications for each part
of the system (tied to packages by the system), test cases, test
results, documentation and release notes, tracking information for
hardware versions, plus entire build environments.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e225" id="d0e225"></a>Looking after
the source</h2>
</div>
<p>Finally, we should be thinking about what we do with the source
code as we work on it. You can never fully account for human
stupidity. 'Top secret' company work should not be left on a laptop
in an unlocked car, for example. Likewise source code should not be
left on a publicly accessible network.</p>
<p>An element of professionalism includes understanding the terms
of any contract that you might be working under - and acting
appropriately. Many employment contracts limit who you can discuss
work related information with, and also assign rights to any work
you produce to that company. Tied with this is the common use of
<span class="emphasis"><em>non disclosure agreements</em></span>
(or NDAs), legally binding agreements which prevent information
shared between companies from being leaked to parties outside the
agreement.</p>
<p>Programmers should also be careful to ensure that their log-in
passwords are known only by themselves, as should any computer
system user. Outsiders (and even possibly malicious insiders)
should not be able to sabotage work using inappropriate access
rights.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e237" id=
"d0e237"></a>Conclusion</h2>
</div>
<p>We have discussed various methods of working that ensures we
take responsibility for the source code we create to ensure that we
do so in a safe and controlled manner.</p>
<p>I have not really spent too much time with any of the
proprietary source control tools mentioned in this article. Perhaps
readers who have would write a few words on their experiences with
them for the Member's Experiences section of C Vu.</p>
<div class="sidebar">
<p class="title c3">Development Monkeys</p>
<p><span class="emphasis"><em>contributed from the
Internet</em></span></p>
<p>A tourist walked into a pet shop and was looking at the animals
on display. While he was there, another customer walked in and said
to the shopkeeper:</p>
<p>&quot;I'll have a C monkey please.&quot;</p>
<p>The shopkeeper nodded, went over to a cage at the side of the
shop and took out a monkey. He fitted a collar and leash, handed it
to the customer, saying: &quot;That'll be $5,000.&quot; The customer paid and
walked out with his monkey.</p>
<p>Startled, the tourist went over to the shopkeeper and said,
&quot;That was a very expensive monkey. Why did it cost so much?&quot;</p>
<p>The shopkeeper answered, &quot;Ah, that monkey can program in C -
very fast, tight code, no bugs, well worth the money.&quot;</p>
<p>The tourist looked at the monkey in another cage. That one's
even more expensive! $10,000! What does it do?&quot;</p>
<p>&quot;Oh, that one's a C++ monkey; it can manage object-oriented
programming, Visual C++, even some Java. All the really useful
stuff,&quot; said the shopkeeper.</p>
<p>The tourist looked around for a little longer and saw a third
monkey in a cage of its own. The price tag around its neck read
$50,000.</p>
<p>He gasped to the shopkeeper, &quot;That one costs more than all the
others put together! What on earth does it do?&quot;</p>
<p>The shopkeeper replied, &quot;Well, I haven't actually seen it do
anything, but the other monkeys call him the Project Manager.&quot;</p>
</div>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e270" id="d0e270"></a>References</h2>
</div>
<div class="bibliomixed"><a name="RCS" id="RCS"></a>
<p class="bibliomixed">[RCS] RCS. Available from: <span class=
"bibliomisc"><a href="http://www.gnu.org/software/rcs/rcs.html"
target="_top">www.gnu.org/software/rcs/rcs.html</a></span> See also
[<span class="bibliomisc"><a href="#MKS">MKS</a></span>].</p>
</div>
<div class="bibliomixed"><a name="CVS" id="CVS"></a>
<p class="bibliomixed">[CVS] CVS. Available from: <span class=
"bibliomisc"><a href="http://www.cvshome.org/" target=
"_top">www.cvshome.org/</a></span></p>
</div>
<div class="bibliomixed"><a name="CVSgui" id="CVSgui"></a>
<p class="bibliomixed">[CVSgui] WinCVS/MacCVS. Available from:
<span class="bibliomisc"><a href="http://www.cvsgui.org" target=
"_top">www.cvsgui.org/</a></span></p>
</div>
<div class="bibliomixed"><a name="Cervisia" id="Cervisia"></a>
<p class="bibliomixed">[Cervisia] Cervisia. Available from:
<span class="bibliomisc"><a href="http://cervisia.sourceforge.net"
target="_top">cervisia.sourceforge.net/</a></span></p>
</div>
<div class="bibliomixed"><a name="cvsweb" id="cvsweb"></a>
<p class="bibliomixed">[cvsweb] cvsweb. Available from:
<span class="bibliomisc"><a href=
"http://stud.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi/" target=
"_top">stud.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi/</a></span></p>
</div>
<div class="bibliomixed"><a name="PRCVS" id="PRCVS"></a>
<p class="bibliomixed">[PRCVS] PRCVS. Available from: <span class=
"bibliomisc"><a href="http://www.xcf.berkeley.edu/~jmacd/prcs.html"
target="_top">www.xcf.berkeley.edu/~jmacd/prcs.html</a></span></p>
</div>
<div class="bibliomixed"><a name="MKS" id="MKS"></a>
<p class="bibliomixed">[MKS] MKS. Source Integrity. Available from:
<span class="bibliomisc"><a href=
"http://www.mks.com/products/scm/si/" target=
"_top">www.mks.com/products/scm/si/</a></span></p>
</div>
<div class="bibliomixed"><a name="Microsoft" id="Microsoft"></a>
<p class="bibliomixed">[Microsoft] Microsoft. Visual SourceSafe.
Available from: <span class="bibliomisc"><a href=
"http://www.microsoft.com/" target=
"_top">www.microsoft.com/</a></span></p>
</div>
<div class="bibliomixed"><a name="Merant" id="Merant"></a>
<p class="bibliomixed">[Merant] Merant. PVCS. Available from:
<span class="bibliomisc"><a href="http://www.pvcs.com/" target=
"_top">www.pvcs.com/</a></span></p>
</div>
</div>
<div class="footnotes"><br>
<hr class="c4" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e66" href="#d0e66" id=
"ftn.d0e66">1</a>]</sup> It seems that NT is, as a workstation
system, less likely to be backed up than Unix. Perhaps this is
because it is harder to do, or more likely to need an expensive
proprietary backup package.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e126" href="#d0e126" id=
"ftn.d0e126">2</a>]</sup> This may seem draconian, but tends to
increase responsibility in programming, if certain rights are
required before some code can be modified.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e194" href="#d0e194" id=
"ftn.d0e194">3</a>]</sup> Or in some people's opinion 'worse'</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e217" href="#d0e217" id=
"ftn.d0e217">4</a>]</sup> The compilation environment is far more
important than many people realise. It incorporates issues such as
compiler runtime flags and versions, what other software is
installed on the machine at the same time, and even the physical
build hardware itself.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
