    <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  :: The Wall - Your Letters etc.</title>
        <link>https://members.accu.org/index.php/articles/1166</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">Letters to the Editor + CVu Journal Vol 14, #2 - Apr 2002</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/c186/">LettersEditor</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/c115/">142</a>
<br />

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

                    -                        <a href="https://members.accu.org/index.php/articles/c186+115/">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;The Wall - Your Letters etc.</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 08 April 2002 13:15:51 +01:00 or Mon, 08 April 2002 13:15:51 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e20" id="d0e20"></a>Re: A Little
Class</h2>
</div>
<p>Dear Detlef,</p>
<p>The October issue of C Vu has remained by my bedside open at
your article for the last 3 months and I must confess that I have
had the greatest difficulty in really understanding what is going
on in this class. I have tried about 5 times to get through it.</p>
<p>Now I do not wish to criticise because I am pleased that you
wrote the article - it highlights huge gaps in my knowledge - but I
thought it might be helpful for you to know about the areas that I
struggled with.</p>
<p>First it would have been helpful as an introduction to give an
illustration of what stamp actually does and what the internal
variables might look like after 5 applications</p>
<p>Second I found the inclusion of a namespace something of a
diversion - is it really necessary to introduce this concept and if
so why is it good practice?</p>
<p>Third, I did not understand the explanations of the methods of
<tt class="classname">StringCounter</tt> and why it is so necessary
to make one of the methods <tt class="literal">explicit</tt>.</p>
<p>Fourth I got lost with the algorithm. I found it difficult to
visualise a picture of what is actually happening.</p>
<p>I then wondered if there could be a simpler way to tackle this
problem and this might be what you refer to in your opening
paragraph:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Keep track of a Long Integer that holds the value of the
&quot;number&quot; just issued</p>
</li>
<li>
<p>Convert this to a number in base 26 arithmetic by using the
modulo function and hold the result in a vector</p>
</li>
<li>
<p>Look up the relevant alphabetic characters using the numbers in
the vector</p>
</li>
</ol>
</div>
<p>This has the merit that incrementing the counter is very easy;
it's arithmetic not a complex string manipulation.</p>
<p><span class="emphasis"><em>Robert Pauer</em></span></p>
<p><span class="bold"><b>Detlef's reply</b></span></p>
<p>Dear Robert,</p>
<p>Thank you for your comments. It's always helpful to get some
feedback on my writing, so I can learn how to make it better next
time (hopefully). So I really appreciate that you took the time to
write down your problems with my article.</p>
<p>Regarding the explanation of the algorithm: I completely agree.
I knew that this was the weak point of my article and even more, I
know that too few illustrations is a general fault of all my
documents. But every time I write something new, I forget about
this.</p>
<p>Obviously, for me are writing and drawing two completely
different activities, and if I do the one, I forget about the other
:-( Perhaps as an excuse, the real motivation to write that article
was not to provide a (quick'n'dirty) solution to this particular
problem, but to show a bit more in general how to write a class of
professional quality that would pass a real code review.</p>
<p>About the namespace topic: yes, for a quality class a namespace
is a must. For a (probably too detailed) article on namespaces look
back to Sean Corfield's article &quot;What's in a name?&quot; in Overload 10,
it can also be found on the internet at <a href=
"http://www.corfield.org/cplusplus.phtml?cpp=name" target=
"_top">http://www.corfield.org/cplusplus.phtml?cpp=name</a></p>
<p>The keyword <tt class="literal">explicit</tt> also deserves a
full article; the short message is: always use <tt class=
"literal">explicit</tt> on constructors that can be called with one
argument except where you definitely want otherwise.</p>
<p>Your solution is definitely a valid one, and it's probably also
simpler, as you write, as most manipulations are done in integer,
and most programmers are more comfortable with numbers than with
strings. But part of the exercise for me was to learn something
about <tt class="classname">std::string</tt>, so to count inside of
a string was actually a good opportunity for me. Also, the
algorithm itself is not really complicated, it's essentially just
counting in base 26 arithmetic. It's just my explanation that is
complicated, and if I had tried to explain how to convert an
integer into a string representing that number in base 26, I would
probably have made it even more complicated ;-)</p>
<p>Best wishes</p>
<p><span class="emphasis"><em>Detlef</em></span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
