    <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/journals/797</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 17, #2 - Apr 2005 + Francis' Scribbles from CVu journal</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/c97/">172</a>
                    (12)
<br />

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

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

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

                                            <a href="https://members.accu.org/index.php/journals/c97-181/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/journals/c97+181/">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> 06 April 2005 13:16:11 +01:00 or Wed, 06 April 2005 13:16:11 +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>Books</h2>
</div>
<p>A couple of readers have responded to the item in my Bookcase
editorial:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>Now to turn to something positive, and something you can all
join in. I would like readers to do three things. First select the
book that you have read that you think has been most underrated or
overlooked. Just one, and I know that makes it hard for some but
the effort of choosing can focus the mind. Of course there are no
right answers but it will be interesting if some books turn up more
than once (and if only three readers respond &hellip;)</p>
<p>The second thing is to choose a category (novice programmer,
newcomer to C++, embedded systems developer, games developer, etc.)
and list which books you would recommend given a) a budget of
&pound;100 ($180) and b) a budget of &pound;250 ($450).</p>
<p>And lastly, given a budget of &pound;2000 ($3600) list what
software development tools and references you would take with you
for a year's stay on a desert island. The desert island comes
equipped with the essentials for life and electric power.</p>
</blockquote>
</div>
<p>Before I hand you over to them, I would like to list a few books
that I think are either underrated or frequently overlooked. Some
of these are out of print though if people understood their quality
they would not be.</p>
<p><i class="citetitle">Ruminations on C++</i> by Andy Koenig and
Barbara Moo. Its present ranking on amazon.com of 350, 000+ is a
complete disgrace. This is one of the most readable books on C++
and should be essential reading for every new C++ programmer.</p>
<p><i class="citetitle">Programming on Purpose (I, II and III)</i>
by P. J. Plauger</p>
<p><i class="citetitle">Programming Pearls &amp; More Programming
Pearls</i> by Jon Bentley</p>
<p>Those five books should be read by every aspiring programmer.
That may prove difficult as two of Plauger's books are out of print
and the third only available in Facsimile as is <i class=
"citetitle">More Programming Pearls</i>. <i class=
"citetitle">Programming Pearls</i> is the only one with an <a href=
"http://www.amazon.com" target="_top">amazon.com</a> rank below
400,000, and even that has a miserly ranking in the 43000s.</p>
<p><i class="citetitle">Multi-Paradigm Design for C++</i> by James
Coplien with an amazon.com sales rank of 488, 000+ is another book
that deserves a much wider readership, this time among the more
experienced C++ users.</p>
<p><i class="citetitle">Confessions of a Used Program Salesman</i>
by Will Tracz. The amazon.com sales rating of 949, 000+ shows how
poorly known this book is. Readers almost invariably sing its
praises, but still it languishes gathering dust. I suspect this
book would have been my choice for the most overlooked book.</p>
<p><i class="citetitle">Obfuscated C and Other Mysteries</i> by Don
Libes (amazon.com sales rank: 869,000+). This book teaches a great
deal about good C programming by exposing the reader to programs
from the annual Obfuscated C competition. It is a rich source of
study material for the aspiring C programmer.</p>
<p><i class="citetitle">C Traps and Pitfalls</i> by Andy Koenig is
only in the 160,000 on <a href="http://www.amazon.com" target=
"_top">amazon.com</a>. That is pretty poor for a book that should
be read by every aspiring C programmer.</p>
<p><i class="citetitle">Expert C Programming</i> by Peter van der
Linden. This book is not quite so badly rated as most of the above,
but with a sales rating of 101, 000+ on amazon.com it deserves much
better. Even C++ programmers could learn quite a bit by reading
it.</p>
<p>There are quite a few others but I offer you the above as a
starter. What other books on programming and software development
should be in this list? Let me give a guideline for your search.
What book would you recommend to at least one category of software
developer whose current sales rank on amazon.com is worse than 250,
000? What can we do to improve things so that these books become
better known? Please do not sit back and let others do the work.
Just as open software development draws in the skills of many
people, we can do the same thing for other types of project.</p>
<p>I would like to see ACCU develop high quality reading lists for
different target audiences, but it would be most unreasonable to
expect one person to any one of them. For example, what should be
the reading list for someone who aspires to be a games programmer?
A process of progressive refinement should be applied to such a
list. In other words, we need dialogue, we need you (yes I mean
you, the person reading this now) to get involved. We need
preliminary lists and we need others to review those lists (the
lists, not the books). If we do the job right we can seriously
influence the development and training of software developers.
Ideally our lists should become the basis for University reading
lists for the areas we target.</p>
<p>Now to those two reader submissions.</p>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e86" id="d0e86"></a>From Jez
Higgins</h3>
</div>
<p>Been thinking about your wretchedly difficult competition for
the last couple of weeks now. Am now at the point where I have to
mail you or it will haunt me forever.</p>
<p><span class="bold"><b>Underrated or overlooked book:</b></span>
Software Tools in Pascal by Kernighan and Plauger. Now obviously
this is not some amazing undiscovered gem, because you frequently
see it mentioned and it is still in print after nigh on 25 years.
We do work, however, in an industry where a book a year old can be
past its sell-by date, and that makes it easy to discount a book
that was published when many of my work colleagues were unwrapping
their ZX81s. Often, when I recommend it, people say &quot;in Pascal?&quot;
and laugh in a nervous are-you-going-mad way.</p>
<p>Once they actually read it, they are generally converted. There
is a clarity in the writing, coupled with a strong narrative.
Starting with an almost laughably simple program to copy the input
to the output, it builds to a rather capable line editor, text
processing and macro processing almost without you noticing. All
the time it stresses good practice - refactoring, library building
and so on. That the code is in an obsolete language is almost an
advantage in these modern times. Everyone can read Pascal, even if
they've never encountered it before, and translating to your
language of choice is a useful exercise of itself. It is just
super.</p>
<p><span class="bold"><b>Books for &lt;someone&gt;:</b></span> My
category is a C++ programmer who did not actually train as a
programmer, sort of fell into it by accident, and who works alone
or in a small, inexperienced team of people. They are generally
keen, but lack direction so have to rediscover everything for
themselves. The first selection to &pound;100 leans toward good
practice.</p>
<p><i class="citetitle">Code Complete</i> by Steve McConnell,
&pound;23.79 - changed how I work</p>
<p><i class="citetitle">The Practice of Programming</i> by
Kernighan and Pike, &pound;17.23 - changed how I work more</p>
<p><i class="citetitle">The C++ Standard Library</i> by Nico
Josuttis, &pound;29.91</p>
<p><i class="citetitle">The Pragmatic Programmer</i> by Hunt and
Thomas, &pound;23.19</p>
<p>On up to &pound;250, I would add in some more C++ specific
advice, together with a couple of books to remind them that good
practice goes wider than just the code in front of you.</p>
<p><i class="citetitle">The C++ Standard</i>, &pound;24.47</p>
<p><i class="citetitle">Effective C++</i> by Meyers,
&pound;25.49</p>
<p><i class="citetitle">Effective STL</i> by Meyers,
&pound;21.69</p>
<p><i class="citetitle">Managing Projects with GNU Make</i> by
Mecklenburg and Oram, &pound;15.71 - if there was one program I
could have &quot;invented&quot; it's make CVS Pocket Reference by Purdy,
&pound;6.95 Software Tools in Pascal by Kernighan and Plauger,
&pound;19.99 at Amazon</p>
<p><i class="citetitle">Writing Solid Code</i> by Steve Maguire,
&pound;9.95 used at Amazon - the homely anecdotal pair to Code
Complete's rigour</p>
<p><i class="citetitle">The Mythical Man Month</i> by Brooks,
&pound;22.99</p>
<p><span class="bold"><b>Castaway tools and references:</b></span>
This is extremely difficult. It rather depends on what I would
spend my time working on if I did not have to work. Since I am
finishing up an XPath engine, I suppose I might have a crack at an
XSLT 2.0/XPath 2.0/XQuery implementation. In addition, maybe try a
bit of games programming. I'm not sure I can actually get close to
the &pound;2000 limit. Most of the tools I use are available at no
cost - emacs, CVS, grep, gcc and so on, although I might also go
for a couple of Visual C++. The standard version would probably be
fine.</p>
<p>I'd take the books listed above, plus</p>
<p class="citetitle c2">C Standard</p>
<p><i class="citetitle">C++ Templates</i> by Vandevoorde and
Josuttis</p>
<p><i class="citetitle">Standard C++ IOStreams</i> by Langer and
Kreft,</p>
<p><i class="citetitle">Java in a Nutshell</i> by Flanagan,</p>
<p><i class="citetitle">XML in a Nutshell</i> by Harold and
Means,</p>
<p><i class="citetitle">XSLT</i> by Tidwell,</p>
<p><i class="citetitle">Python Cookbook</i> by Martelli and
Ascher,</p>
<p><i class="citetitle">Programming Pearls</i> by Bentley,</p>
<p>The XML, DOM, XPath 2.0, XSLT 2.0 and XQuery recommendations</p>
<p>Friedl's <i class="citetitle">Mastering Regular
Expressions</i>,</p>
<p><i class="citetitle">Philip and Alex's Guide to Web
Publishing</i> by Greenspun - just terrific</p>
<p><i class="citetitle">XML Topic Maps: Creating and Using Topic
Maps for the Web</i> - my friend Kal is a co-author on this, and I
keep meaning to find out what it really is he does,</p>
<p><i class="citetitle">Modern C++ Design</i> by Alexandrescu</p>
<p>A ZX Spectrum emulator and David Webb's Super Charge Your
Spectrum and Advanced Spectrum Machine Language. The latter book
was the first one to really show me that you could have a library
of routines to draw on again and again.</p>
<p>I am showing a singular lack of imagination. I really cannot
think of anything else ...</p>
<p>All prices are from Computer Manuals, unless otherwise
noted.</p>
<p>Even as I type this, I'm doubting myself. Should I have included
Fowler's Refactoring? Booch? Peopleware? Gah. As I said at the
beginning, it has been extremely difficult.</p>
<p class="c2"><span class="remark">When I commented that he did not
seem to have any hardware to use, Jez added the
following:</span></p>
<p>For a box to work on I would take something like a Demonite
Graduate. It does not have to be top of the range, because it is
not like there would be huge pressure of time or enormous builds to
do. The basic ~&pound;825 version would be fine (my own slightly
more expensive one does go like the clappers - they are super). I'd
swap the bundled flat monitor for an Iiyama Vision Master, say the
454 (~&pound;250). I would also throw away the mouse and get a
Logitech TrackMan Marble. I am not sure they still make them, but I
paid about &pound;30 for mine. I did toy with taking two machines,
but decided that would be a bit silly.</p>
<p>Not bothered about OS, so let me take some version of Linux -
Debian or SuSE, say. Most of the tools I use are available at no
cost - emacs, CVS, grep, gcc and so on. If I had gone for Windows,
I would take a copy of Visual C++. Instead, I will take Comeau's
compiler with libcomo ($50), along with Dinkumware's library for
Comeau and gcc ($135).</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e214" id="d0e214"></a>From Thaddaeus
Frogley</h3>
</div>
<p><span class="bold"><b>Most Overlooked/Underrated</b></span></p>
<p class="citetitle c2">Multi Paradigm DESIGN for C++</p>
<p>Note: An incredibly hard one to pick. All my favourite
development books are either popular and highly acclaimed or Highly
Recommended by ACCU Book Reviewers. In the end, I selected this
book because I think many people are put off by the highly academic
style, which can make reading it very hard work. Despite this bar
to wide popularity, I think this book is well worth the effort.</p>
<p><span class="bold"><b>C++ Programmers Essential Reference
Library</b></span></p>
<p>(Prices Based on prices listed on amazon.co.uk, Dec 2004)</p>
<p><span class="bold"><b>For &pound;100:</b></span></p>
<p>&pound;34.99 - <i class="citetitle">The C++ Programming
Language, Special Edition</i></p>
<p>&pound;30.79 - <i class="citetitle">The C++ Standard Library: A
Tutorial and Reference</i></p>
<p>&pound;29.39 - <i class="citetitle">C++ Templates: The Complete
Guide</i></p>
<p><span class="bold"><b>For &pound;250, as above,
plus:</b></span></p>
<p>&pound;24.46 - <i class="citetitle">The C Standard</i></p>
<p>&pound;24.46 - <i class="citetitle">The C++ Standard</i></p>
<p>&pound;29.39 - <i class="citetitle">Standard C++ IO Streams and
Locales: Advanced Programmers Guide and Reference</i></p>
<p>&pound;18.89 - <i class="citetitle">Exceptional C++</i></p>
<p>&pound;20.99 - <i class="citetitle">Effective C++</i></p>
<p>&pound;23.09 - <i class="citetitle">Modern C++ Design: Applied
Generic and Design Patterns</i></p>
<p>Note: In creating a list with the theme of &quot;Reference Library&quot;,
the last three were a tough call.</p>
<p><span class="bold"><b>Desert Island Developers Shopping
List</b></span></p>
<p><span class="bold"><b>Hardware</b></span> (source:
apple.com):</p>
<div class="literallayout">
<p>1.8GHz PowerMac G5<br>
1GB DDR400 SDRAM (PC3200) - 2x512<br>
80GB Serial ATA - 7200rpm<br>
NVIDIA GeForce 6800 GT DDL w/256MB GDDR3 SDRAM<br>
Apple Cinema Display (20&quot; flat panel)<br>
8x Super Drive (DVD-R/CD-RW)<br>
Apple Keyboard &amp; Apple Mouse - U.S. English<br>
Mac OS X - U.S. English<br>
Subtotal $3,423.00</p>
</div>
<p><span class="bold"><b>Software:</b></span></p>
<div class="literallayout">
<p>OS X Development Tools (free download)<br>
Misc Home-brew GameBoy Advance Development Software<br>
i.e. Boycott Advance (GBA Emulator for OS X) &amp; GBA SDK (free /
Open Source)</p>
</div>
<p><span class="bold"><b>References:</b></span></p>
<p>As found online (free)</p>
<p>I am assuming either an internet connection from the island, or
time to download and burn the software and references wanted to a
DVD or two.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e300" id="d0e300"></a>My Comments</h3>
</div>
<p>I found these two interesting responses. One thing I think that
is worth noting is that both found the dash limits on books to be
very tough to meet. I suspect that a minimal library for a serious
software developer would cost of the order of &pound;1000
($2000).</p>
<p>That tells me two things; being a software developer is both
expensive and time consuming. Having the books is not enough; you
have to find time to study them. I think that I am now even more
convinced that we need a concerted effort to get rid of the dross
from the bookshelves (virtual as well as real) and make a great
effort to see that good authors (or authors of good books) get the
sales they deserve.</p>
<p>The vast number of bad and mediocre books taking up space is
making it very difficult for the newcomer to find good books.
Unfortunately, when we start listing the reading requirements the
costs begin to daunt. You can easily spend much more on books than
on hardware and an order of magnitude more than you need to spend
on software.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e309" id="d0e309"></a>The Winner</h3>
</div>
<p>Because there are only two submissions, I am not going to toss
for which wins. Instead, I am going to award them both a choice of
any book currently in print, costing under &pound;45 published by
Addison-Wesley, Wiley, Prentice Hall or O'Reilly.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e314" id="d0e314"></a>Commentary on
Problem 18</h2>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p>Some programmers seem to hate to use more names in their
programs than they absolutely have to. Your challenge is to write a
program in C++ that outputs the first n members of the Fibonacci
series where the user will provide the value of n at runtime.</p>
<p>That is easy for most readers. However, there is a limitation,
you must use i as the name of any variable, function, type or
namespace that you declare. You may use anything you like from the
Standard (such as <tt class="function">main</tt>, <tt class=
"classname">std::cin</tt> and <tt class=
"classname">std::cout</tt>).</p>
</blockquote>
</div>
<p>What is it about programmers that they tackle writing bad code
with such enthusiasm and inventiveness? Because the problem had
come to mind because of a novice's attempt at generating Fibonacci
numbers recursively, I had completely missed the potential for code
such as:</p>
<pre class="programlisting">
#include &lt;stdio.h&gt;
int main() {
  int i[] = {1, 1, 2, 0};
  puts(&quot;How many values?&quot;);
  scanf(&quot;%d&quot;, i+3);
  puts(&quot;The results are: \n\t1\n\t1&quot;);
  while(i[2]&lt;i[3]) {
    i[1] += i[0];
    i[0] = i[1] - i[0];
    printf(&quot;\t%d\n&quot;, i[1]);
    i[2]++;
  }
  return 0;
}
</pre>
<p>That source code gives the lie to my contention that the problem
could not be done in C. The solution I was thinking of is:</p>
<pre class="programlisting">
#include &lt;iostream&gt;
int i(int i) {
  if(i &lt; 0) return 0;
  if(i &lt; 2) return 1;
  return ::i(i-1) + ::i(i-2);
}
int main() {
  std::cout &lt;&lt; &quot;How many members?&quot;;
  int i;
  std::cin &gt;&gt; i;
  -i;
  do {
    std::cout &lt;&lt; ::i(i) &lt;&lt; '\n';
  } while(-i &gt; -1);
}
</pre>
<p>Obviously, the above solution cannot be implemented in C because
C does not allow a distinction between local and global variables.
A local variable name in C always hides a global declaration of the
same name (except when the global name is declared as a type name
by using the <tt class="literal">struct</tt>, <tt class=
"literal">union</tt> or <tt class="literal">enum</tt> keywords.</p>
<p>My thanks to Martin Stuart, James Talbut and Ian Glover who all
came up with excellent C++ solutions. However, the best I think was
Tim Sharrock's creative use of <tt class=
"classname">std::vector</tt>:</p>
<pre class="programlisting">
#include &lt;ostream&gt;
#include &lt;istream&gt;
#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
int main() {
  std::vector&lt;int&gt; i(1);
  std::cin &gt;&gt; i[0];
  std::cout &lt;&lt; &quot;first &quot; &lt;&lt; i[0] 
            &lt;&lt; &quot; terms of the fibonacii &quot;
               &quot;sequence are:\n&quot;;
  while(i[0]- &gt; 0) {
    i.push_back((i.size()&lt;3)
      ? int(i.size()-1)
      : (i.back()+*(i.end()-2)));
  }
  std::copy(i.begin()+1,i.end(),
            std::ostream_iterator&lt;int&gt;(
                              std::cout,&quot; &quot;));
  std::cout &lt;&lt; &quot;\n&quot;;
}
</pre>
<p>Ian Glover also offered this interesting C solution:</p>
<pre class="programlisting">
#include &lt;stdio.h&gt;
#include &lt;math.h&gt;
/* Cheating slightly declaring I, but GCC won't compile the rest without it and we never use it! */
int main(int I, char* i[]) {
  while(strtol(i[1], 0, 10)) {
    printf(&quot;%d\n&quot;, 
      (long)((pow((0.5 + sqrt(5.0)/2.0),
                 (double)strtol(i[1], 0, 10))
                  - pow((0.5 - sqrt(5.0)/2.0), 
                 (double)strtol(i[1], 0, 10)))
                  /sqrt(5.0)));
/* The nasty hack */
    sprintf(i[1], &quot;%d&quot;,
            (strtol(i[1], 0, 10) - 1));
  }
  return 0;
}
</pre>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e361" id="d0e361"></a>Cryptic clues
for numbers</h3>
</div>
<p>Here is last issue's clue:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>Deuce, it sounds like they came for tea twice. (4 digits)</p>
</blockquote>
</div>
<p>As many of you worked out, the answer is 4040</p>
<p>Margaret Wood came up with:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>Intel's first microprocessor? No, I've heard this one is double
strength.</p>
</blockquote>
</div>
<p>I feel sure I had another one, but I seem to have mislaid
it.</p>
<p>Now try this one:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>A first course on C++ at the University of Rome [3 digits]</p>
</blockquote>
</div>
<p>When hunting for alternate clues you might remember that we are
considering strings of digits rather than numerical values. And
that is about all the extra I am willing to give you.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
