Journal Articles
Browse in : |
All
> Journals
> CVu
> 172
(12)
All > Journal Columns > Francis' Scribbles (29) Any of these categories - All of these categories |
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. 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/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: Francis' Scribbles
Author: Administrator
Date: 06 April 2005 13:16:11 +01:00 or Wed, 06 April 2005 13:16:11 +01:00
Summary:
Body:
A couple of readers have responded to the item in my Bookcase editorial:
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 …)
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 £100 ($180) and b) a budget of £250 ($450).
And lastly, given a budget of £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.
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.
Ruminations on C++ 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.
Programming on Purpose (I, II and III) by P. J. Plauger
Programming Pearls & More Programming Pearls by Jon Bentley
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 More Programming Pearls. Programming Pearls is the only one with an amazon.com rank below 400,000, and even that has a miserly ranking in the 43000s.
Multi-Paradigm Design for C++ 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.
Confessions of a Used Program Salesman 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.
Obfuscated C and Other Mysteries 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.
C Traps and Pitfalls by Andy Koenig is only in the 160,000 on amazon.com. That is pretty poor for a book that should be read by every aspiring C programmer.
Expert C Programming 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.
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.
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.
Now to those two reader submissions.
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.
Underrated or overlooked book: 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 "in Pascal?" and laugh in a nervous are-you-going-mad way.
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.
Books for <someone>: 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 £100 leans toward good practice.
Code Complete by Steve McConnell, £23.79 - changed how I work
The Practice of Programming by Kernighan and Pike, £17.23 - changed how I work more
The C++ Standard Library by Nico Josuttis, £29.91
The Pragmatic Programmer by Hunt and Thomas, £23.19
On up to £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.
The C++ Standard, £24.47
Effective C++ by Meyers, £25.49
Effective STL by Meyers, £21.69
Managing Projects with GNU Make by Mecklenburg and Oram, £15.71 - if there was one program I could have "invented" it's make CVS Pocket Reference by Purdy, £6.95 Software Tools in Pascal by Kernighan and Plauger, £19.99 at Amazon
Writing Solid Code by Steve Maguire, £9.95 used at Amazon - the homely anecdotal pair to Code Complete's rigour
The Mythical Man Month by Brooks, £22.99
Castaway tools and references: 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 £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.
I'd take the books listed above, plus
C Standard
C++ Templates by Vandevoorde and Josuttis
Standard C++ IOStreams by Langer and Kreft,
Java in a Nutshell by Flanagan,
XML in a Nutshell by Harold and Means,
XSLT by Tidwell,
Python Cookbook by Martelli and Ascher,
Programming Pearls by Bentley,
The XML, DOM, XPath 2.0, XSLT 2.0 and XQuery recommendations
Friedl's Mastering Regular Expressions,
Philip and Alex's Guide to Web Publishing by Greenspun - just terrific
XML Topic Maps: Creating and Using Topic Maps for the Web - my friend Kal is a co-author on this, and I keep meaning to find out what it really is he does,
Modern C++ Design by Alexandrescu
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.
I am showing a singular lack of imagination. I really cannot think of anything else ...
All prices are from Computer Manuals, unless otherwise noted.
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.
When I commented that he did not seem to have any hardware to use, Jez added the following:
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 ~£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 (~£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 £30 for mine. I did toy with taking two machines, but decided that would be a bit silly.
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).
Most Overlooked/Underrated
Multi Paradigm DESIGN for C++
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.
C++ Programmers Essential Reference Library
(Prices Based on prices listed on amazon.co.uk, Dec 2004)
For £100:
£34.99 - The C++ Programming Language, Special Edition
£30.79 - The C++ Standard Library: A Tutorial and Reference
£29.39 - C++ Templates: The Complete Guide
For £250, as above, plus:
£24.46 - The C Standard
£24.46 - The C++ Standard
£29.39 - Standard C++ IO Streams and Locales: Advanced Programmers Guide and Reference
£18.89 - Exceptional C++
£20.99 - Effective C++
£23.09 - Modern C++ Design: Applied Generic and Design Patterns
Note: In creating a list with the theme of "Reference Library", the last three were a tough call.
Desert Island Developers Shopping List
Hardware (source: apple.com):
1.8GHz PowerMac G5
1GB DDR400 SDRAM (PC3200) - 2x512
80GB Serial ATA - 7200rpm
NVIDIA GeForce 6800 GT DDL w/256MB GDDR3 SDRAM
Apple Cinema Display (20" flat panel)
8x Super Drive (DVD-R/CD-RW)
Apple Keyboard & Apple Mouse - U.S. English
Mac OS X - U.S. English
Subtotal $3,423.00
Software:
OS X Development Tools (free download)
Misc Home-brew GameBoy Advance Development Software
i.e. Boycott Advance (GBA Emulator for OS X) & GBA SDK (free /
Open Source)
References:
As found online (free)
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.
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 £1000 ($2000).
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.
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.
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.
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 main, std::cin and std::cout).
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:
#include <stdio.h> int main() { int i[] = {1, 1, 2, 0}; puts("How many values?"); scanf("%d", i+3); puts("The results are: \n\t1\n\t1"); while(i[2]<i[3]) { i[1] += i[0]; i[0] = i[1] - i[0]; printf("\t%d\n", i[1]); i[2]++; } return 0; }
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:
#include <iostream> int i(int i) { if(i < 0) return 0; if(i < 2) return 1; return ::i(i-1) + ::i(i-2); } int main() { std::cout << "How many members?"; int i; std::cin >> i; -i; do { std::cout << ::i(i) << '\n'; } while(-i > -1); }
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 struct, union or enum keywords.
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 std::vector:
#include <ostream> #include <istream> #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> i(1); std::cin >> i[0]; std::cout << "first " << i[0] << " terms of the fibonacii " "sequence are:\n"; while(i[0]- > 0) { i.push_back((i.size()<3) ? int(i.size()-1) : (i.back()+*(i.end()-2))); } std::copy(i.begin()+1,i.end(), std::ostream_iterator<int>( std::cout," ")); std::cout << "\n"; }
Ian Glover also offered this interesting C solution:
#include <stdio.h> #include <math.h> /* 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("%d\n", (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], "%d", (strtol(i[1], 0, 10) - 1)); } return 0; }
Here is last issue's clue:
Deuce, it sounds like they came for tea twice. (4 digits)
As many of you worked out, the answer is 4040
Margaret Wood came up with:
Intel's first microprocessor? No, I've heard this one is double strength.
I feel sure I had another one, but I seem to have mislaid it.
Now try this one:
A first course on C++ at the University of Rome [3 digits]
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.
Notes:
More fields may be available via dynamicdata ..