Just A Summary

Piers Cawley Practices Punditry

Reading Beautiful Code

Posted by Piers Cawley Tue, 21 Aug 2007 18:49:57 GMT

I’m reading Beautiful Code and it’s very good indeed. However, you have to feel sorry for Tim Bray – his chapter, “Finding Things” is excellent, as you’d expect. The only problem is, he’s following Jon Bentley, author of that perennial classic, Programming Pearls. It’s been a while since I (re)read anything by Bentley and I’d forgotten how good his prose was.

Which isn’t to say that Tim Bray is a bad writer. Far from it. It’s just that Jon Bentley is a very good one indeed.

Apart from that, Beautiful Code is a cracking book so far, and the royalties go to Amnesty International. You should buy a copy.

Holiday Reading

Posted by Piers Cawley Sat, 21 Jul 2007 17:21:00 GMT

Mmm… back from Scotland with a chunk of reading done:

Harry Potter And The Deathly Hallows. Mmm… top notch stuff. Wraps up the series perfectly.

The Book Thief. Wow! Seriously… wow. Whatever you do, don’t read the last chapter of this in public. I was a wreck. Beautiful. Sad. Really Sad. Life affirming stuff. Read it.

The Complete Polysyllabic Spree. Nick Hornby writes exceedingly good litcrit/columns.

Compilers: Principles, Techniques and Tools aka The Dragon Book. Good, crunchy computer science full of stuff I’ve skirted around learning for ages now. I’m still far from finished with this book. It does feel old fashioned though, and a little light on techniques for implementing highly dynamic languages.

Programming Language Pragmatics. More seriously crunchy computer science; I’ve only really skimmed the surface of this one so far, but I’m liking it a lot so far.

The Amazing Adventures of Kavalier & Clay. Another wow. What’s not to like? Golden Age Comic book history. Close up magic and escape artistry. Nazis! Citizen Kane! Astonishing, page turning, storytelling. No wonder it won a Pulitzer. It might well make you cry too (though not as much as The Book Thief)

The Essential Turing. You know how everyone who knows anything about computing tells you that Alan Turing was a genius? They’re right. I knew they were right before I read On Computable Numbers, with an Application to the Entscheidungsproblem (the first paper in this book and the only one I’ve read so far), but the paper drove home how much of a genius he was. The way he bootstraps from the idea of the Turing Machine to a Universal Turing Machine is just beautiful – one minute he’s describing the basic workings of a seemingly simple machine and a few conventions he intends to use and then within a few pages he’s implementing a Universal Turing Machine and describing it using the kind Higher Order Functions that get ‘metaprogrammers’ so excited whenever the come across a language like Ruby. Great, great stuff.

Why don't more books work like this?

Posted by Piers Cawley Sun, 06 May 2007 02:57:00 GMT

When you read Christopher Alexander’s A Pattern Language, the patterns within the language are interdependent and ordered from big patterns down to small ones. Each pattern has a number and wherever one pattern refers to another it’s referenced with both the pattern’s name and its number.

Beck, Fowler and the Gang of Four (if memory serves) go one better, wherever they reference a pattern, they give the pattern’s page number (ah, the joys of computer typesetting). I’m not sure it’s an enormous improvement over pattern numbers with the pattern numbers in the running heads, but both practices make the books easy to use.

Writing this up as mini patterns, (very roughly based on Alexander’s pattern format) you’d have something like:

A Tiny Pattern Language for technical writers

1. Organizing Principle

You’re writing a Pattern Language on paper

Without some organizing principle, a random collection of patterns is just that

When you’re organizing material in a book which needs to be usable both as a learning resource and as reference material there’s a tension between the needs of the new reader who wants each pattern to follow logically from the patterns she has already read about, and the needs of a seasoned pattern user who needs to find details of a specific pattern.

It’s tempting to take the view that a reader is only new once, so it’s best to arrange the material to suit the reference user and put your patterns in alphabetical order. Don’t. If your material doesn’t make sense to the new reader, they’ll never reach the point where they use your book as a reference.

Therefore:

Arrange your patterns for new readers. Provide an index and cross references to support reference use

Use Arrange Patterns by Scale(2) to order your patterns and Reference by Name and Number(3) for your cross references. Provide a Table of Contents and an Alphabetical Index.

2. Arrange Patterns by Scale

You’re choosing an Organizing Principle(1) for your pattern language

It’s hard to understand a pattern without some idea of where it fits in the scheme of things

Read A Pattern Language, look at the way that each pattern in the book flows from the ones that precede it and leads you on to the patterns that support it. There’s a huge amount of information in that book, but it just flows. It has The Quality Without A Name.

Now read Universal Principles of Design, another book which contains a great deal of good information backed up with great pictures and some real research. Each spread in the book is analogous to a Design Pattern, and each spread is great. It’s a bugger to read though. The designers have chosen to arrange their principles in alphabetical order; reading through is like being taken on a drunkard’s walk by a conceptual grasshopper. Many of the principles are hierarchical, but the reader is left to work that out for themselves. It reminds me of the joke about reading a dictionary; the content’s great, but the characterisation and plot are all over the place.

Therefore:

Find patterns that use other patterns, put them before the patterns they use. Group patterns with a similar scale or motivation in chapters.

3. Reference by name and page number

You’re referring to a pattern.

Why can’t books be more like the web?

We’ve all done it I’m sure; one part of a book refers to another part and gives just the section title. We curse the author or his editor and go scurrying off to the table of contents or the index to find the referenced page and then turn to it, all the while keeping our index finger jammed between the pages so we don’t lose our original place.

Or the author has taken pity on us and, following the Chicago manual of style, supplies a section number (with multiple decimal points) and we start flipping forwards or backwards to find the right section number. This is less fun than it could be because no two sections are the same length. Or the content’s arranged alphabetically, and every section is the same length, but we’re not entirely sure of how many sections start with any given letter – I’m looking at you Universal Principles of Design.

There has to be a better way. Wouldn’t it be great if we could just go directly to the right page as if we were following a hypertext link?

Indeed it would.

Therefore:

Whenever you refer to another pattern, use both the pattern’s name and its page number; that way the reader can turn directly to the right page without having to visit an index or flip hopefully trying to guess how long each section is.

What next?

Obviously we need to hunt down and deliver a good telling off to authors, editors and publishing houses that don’t follow this pattern language.

Would you believe that I started this article meaning to write a review of Universal Principles of Design? Despite my grumbles about it above, it’s a cracking book full of really meaty stuff. I commend it to you all.

Spiers and Boden: Songs

Posted by Piers Cawley Sat, 15 Oct 2005 09:22:00 GMT

Listen to this. You’ll not regret it.

Whee! John Spiers and Jon Boden have finally made an album (Songs) that sounds as good as they do live. Not that Through and Through and Bellow are bad albums, it’s just that their playing has improved somewhat since they were recorded. On stage, Jon and John play with an almost telepathic level of communication. Songs captures that magic.

Had we but world enough, and time: Serenity

Posted by Piers Cawley Fri, 07 Oct 2005 00:51:00 GMT

Joss Whedon’s Firefly was a sf series that was never given time; episodes were jumbled by the network and the show got cancelled just when it was starting to build a serious fanbase. And that’s all she wrote.

Except, as fans of Buffy and Angel know, Joss Whedon doesn’t tell the same stories as everyone else. He managed to hold his cast together and found the funding to make Serenity. It isn’t quite the film of series they didn’t have time to make, but it comes close.

Capsule review: I liked it. I liked it a lot. You should see it.

For a slightly longer, and possibly spoilery review, kindly step behind this curtain…

A bright light on the culinary road to Damascus

Posted by Piers Cawley Wed, 03 Aug 2005 17:17:26 GMT

If you’ve eaten with me, you might be aware that I’m not a big one for chili heat. I don’t mind it, but you won’t find me chopping up the Scotch Bonnets for a mole or ladling out the chili oil in a Chinese restaurant.

If you’d suggested that I would cook something that involved 3 tablespoons full of chili oil, complete with the sludge of seeds from the bottom of the jar, in a dish for two people I would have thought you had gone mad. If you had then suggested that I’d love the resulting dish with a passion that made me want to rush off and blog about it…

The Pickaxe Book

Posted by Piers Cawley Mon, 01 Aug 2005 14:20:00 GMT

I can’t remember when Adam Turoff pointed me at Ruby On Rails, but I’m still grateful. Blame Adam for the fact that this weblog is no longer running on Movable Type, but on Typo. My initial plan was to roll my own blogging software on top of Rails, but by the time I got my act together it just made sense to grab an existing package and extend it as required.

I first heard about Ruby when I read Andy Hunt and Dave Thomas’s excellent book The Pragmatic Programmer. I thought, “that looks interesting”, so I read the first edition of Programming Ruby aka the Pickaxe Book, learned the syntax and some of the idioms and then sort of forget about it. As a programming language Ruby pushes a lot of my buttons: it has closures, objects all the way down, dynamic typing and its refreshingly concise. However, I never quite got round to writing anything in it (not the language’s fault, I wasn’t writing anything in anything at the time).

Then along came Ruby on Rails and it’s lovely. I saw the first version of the Rails Video and it knocked me out. Rails does so much right. Here was a web development tool that did most of the heavy lifting for you, and makes it easy to do things Right. David Heinemeier Hansson was obviously getting a great deal of leverage from Ruby’s dynamic nature and I wanted some of that.

However, I found that Ruby had moved on since I skimmed the first Pickaxe so I got hold of a copy of the second edition of Programming Ruby. What a cracking book it is. My personal benchmark of quality when it comes to a language reference is the first edition of Programming Perl which, as well as being a language reference was an introduction to a programming ethos. Whilst I don’t think the Pickaxe is quite that good, it’s definitely up there. The chapter on ‘Duck Typing’, for instance, is wonderful. It’s a well made argument for dynamic typing and it deserves to be widely read. I sometimes think that there are two sorts of programmers in the world, those who think typed values are essential, and those who think typed variables are essential. I’m definitely a typed values kind of guy. Typed variables have their place, but that place is in the optimization toolbox next to the profiler.

Ruby’s a great language. I don’t think it’ll ever be my primary language — I still have high hopes for Perl 6, which will have all the things I like about Ruby whilst addressing some of the things about it that make me uncomfortable. But in the unlikely event that Perl 6 crashes and burns, Perl 5 finally has a competitor that I enjoy using if only because I’m sick of typing:

sub foo { my $self = shift; my($arg1, $arg2) = @_;

at the start of every method.

def foo(arg1, arg2)

is just so much shorter. And until I can do

method foo($arg1, $arg2) {

Ruby will entice me. Maybe I should just get Emacs to fill in the Perl 5 boiler plate…

Quite Ugly One Morning

Posted by Piers Cawley Fri, 03 Sep 2004 03:39:00 GMT

Spurred on by the forthcoming adaptation on ITV, I’ve finally got round to reading Christopher Brookmyre’s first novel, Quite Ugly One Morning

Wow.

If you can make it past the (quite disgusting) first chapter, then you’ll be in it for the long haul. Great characters, spiky dialogue, twisty plot, worrying prescience and some fabulously gruesome set pieces and comeuppances.

So, in summary. Buy this book. Then do what I did and buy the other Parlabane books too; they’re worth it for the titles alone.

'Extreme Building'

Posted by Piers Cawley Sat, 30 Aug 2003 09:54:00 GMT

Our experience as contractors, engineers and architects during the last 15 years has proved one thing over and over again: The things placed on drawings are inevitably – always – wrong in many particulars. Drawings serve as an important rough sketch of something that will be built, but must be executed with constant attention to room shape, light, wall and ceiling detail, openings – above all to the feelings which arise in each place, in the construction, as it is taking shape. These feelings are too complicated to predict and cannot be predicted. When a building is built from plans that are conceived on the drawing board and then simply built, the result is sterile at best – silly most of the time – and sometimes unthinkably bad. This is something familiar in virtually all large buildings that have been built since 1950. It is inevitable, given the process of construction used to build them. And it is inevitable that this process must lead to unsatisfactory results.

— Christopher Alexander, Gary Black & Miyoko Tsutsui The Mary Rose Museum

Another installment in my ongoing series of reviews of books that Amazon will take an age to deliver.

"The best thing for being sad" 1

Posted by Piers Cawley Fri, 29 Aug 2003 06:28:00 GMT

“The best thing for being sad,” replied Merlin, beginning to puff and blow, “is to learn something. That’s the only thing that never fails. You may grow old and trembling in your anatomies, you may lie awake at night listening to the disorder of your veins, you may miss your only love, you may see the world about you devastated by evil lunatics, or know your honour trampled in the sewers of baser minds. There is only one thing for it then — to learn. Learn why the world wags and what wags it. That is the only thing which the mind can never exhaust, never alienate, never be tortured by, never fear or distrust, and never dream of regretting. Learning is the only thing for you. Look what a lot of things there are to learn.”
       — T.H. White, The Once and Future King

T.H. White is one of my favourite writers. It’s easy to be dismissive of The Once and Future King, based on the Disney adaptation — which, like their version of The Jungle Books, is great fun but a travesty of the original. However, as I hope the extract shows, there’s rather more to him than that.



Just A Summary