Welcome to Duncan White's Practical Software Development (PSD) Pages.
I'm Duncan White, an experienced and professional programmer, and have been programming for well over 20 years, mainly in C and Perl, although I know many other languages. In that time, despite my best intentions:-), I just can't help learning a thing or two about the practical matters of designing, programming, testing, debugging, running projects etc. Back in 2007, I thought I'd start writing an occasional series of articles, book reviews, more general thoughts etc, all focussing on software development without all the guff.
Book Review: The Pragmatic Programmer: from Journeyman to Master
Authors: Andrew Hunt and David Thomas Publisher: Addison-Wesley Oct 1999 ISBN: 020161622X
This is probably the single best programming book I've ever read. Both Dave Thomas (who, some years before my time, was a student at Imperial College) and Andy Hunt have a really sound range of practical experience in the software industry - 25 years each, I think they say in their Preface - and unlike many authors (Somerville, anyone?) have the gift of communicating their experiences concisely and clearly.
They use a central metaphor of programming as woodworking - which is much more fun than the usual ``design as architecture" metaphor which often seems to leave out the actual process of programming, testing and debugging. They take the woodworking metaphor into fruitful locations - one part of becoming an expert (programmer? master carpenter?) is to develop a varied toolbox of tools with which you are extremely familiar which boost your productivity significantly.
One of the things they focus on, and return to repeatedly, is the important idea of writing code generators - or programs that write programs. They emphasize that this sounds more complex than it is, that a simple code generator can be written in a few minutes and still save hours of work. They also point out that a simple ("passive") code generator designed to be run once does not have to be perfect, if it does 90% of the work but the result needs hand editing - that's fine.
Then they move onto "active" code generators, that produce guaranteed correct code from some simpler input - parser and lexer generators are the obvious examples here, but they can do anything. I'm particularly into code generators and little languages, so this theme chimes well with me. One of my upcoming PSD articles will be about designing a little language and building a code generator tool to transplant a functional language feature (recursive data types) into C and similar languages.
They also summarise their long experience as a series of incredibly useful Tips. Here are a few of my favourites:
Plus my favourite tip of all - I laughed so hard I nearly fell off my chair when reading this for the first time. Because, let's be honest - we've all been there:
- DRY---Don't Repeat Yourself: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
- Keep Knowledge in Plain Text: Plain text won't become obsolete. It helps leverage your work and simplifies debugging and testing.
- Crash Early: A dead program normally does a lot less damage than a crippled one.
- Don't Live with Broken Windows: Fix bad designs, wrong decisions, and poor code when you see them.
- Test Your Software, or Your Users Will: Test ruthlessly. Don't make your users find bugs for you.
- select Isn't Broken: It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.
Of course, there's quite a bit of overlap with Kernighan and Pike's The Practice of Programming (tPoP) (review here) - indeed, the select isn't broken tip is extremely similar to tPoP's observation that beginnners have a tendency to blame the compiler or library (page 119 of the Practice of Programming).
And finally - you must look up Rubber Ducking in the index, both because it's extremely funny (and psychologically accurate) but especially to see a mention of Greg Pugh, another ex-Imperial bod - we get everywhere, I'm telling you! (More overlap again - Rubber Ducking in the Pragmatic Programmer is extremely similar to the Practice of Programming's tell it to the Teddy Bear on page 123 of PoP).
Added May 2013: I gave two first year lectures on C Tools, heavily based on The Pragmatic Programmer's core concept of building a toolkit.
Added Sept 2013: Added the code generators paragraph, and linked to my new review of The Practice of Programming (tPoP).
firstname.lastname@example.org Back to my Practical Software Development Top Page. Updated: Sept 2013