Monthly Archives: December 2008

The bells of waiting Advent ring,
The Tortoise stove is lit again
And lamp-oil light across the night
Has caught the streaks of winter rain
In many a stained-glass window sheen
From Crimson Lake to Hookers Green.

Christmas is one of John Betjeman’s most openly religious poems, and one of my favourites. Published in A Few Late Chrysanthemums, in 1954, it combines a heart-warming Victorian Christmas ideal with a very reluctant religiosity.

It’s often said about Betjeman’s poetry that it allows people to identify with feelings they’ve never known or felt, like a kind of twee horoscope. More than that, I think he actively loved what we all like to think we love, too, and he had the skill and background to put it into words for us all to enjoy.

He inaugurated the Nooks and Corners column in Private Eye, which continues to this day. When I was in Manchester, a small row of houses in East Didsbury was torn down after being featured there, which was very sad. He campaigned vigorously against the post-war fetish of tearing down Victorian buildings, often using his popular status to succeed where others failed.

He contributed to the Shell travel guides, so I suppose he must have visited the North of England, but I don’t think he lived there at all. However, anyone born North of the Watford gap should smile at the first lines of the slightly macabre A Shropshire Lad. “The gas was on in the institute / The flare was up in the gym” – though who, born after 1950, say, knows what they mean?

He’s perhaps best known for his admonition of town planners: “Come friendly bombs and fall on Slough / It isn’t fit for humans now / There isn’t grass to graze a cow / Swarm over, death!”

Betjeman’s poetry is best read aloud: he has an innate understanding of cadence, and is often very funny. Try it!

The holly in the windy hedge
And round the Manor House the yew
Will soon be stripped to deck the ledge,
The altar, font and arch and pew,
So that the villagers can say
‘The church looks nice’ on Christmas Day.

Provincial Public Houses blaze,
Corporation tramcars clang,
On lighted tenements I gaze,
Where paper decorations hang,
And bunting in the red Town Hall
Says ‘Merry Christmas to you all’.

And London shops on Christmas Eve
Are strung with silver bells and flowers
As hurrying clerks the City leave
To pigeon-haunted classic towers,
And marbled clouds go scudding by
The many-steepled London sky.

And girls in slacks remember Dad,
And oafish louts remember Mum,
And sleepless children’s hearts are glad.
And Christmas-morning bells say ‘Come!’
Even to shining ones who dwell
Safe in the Dorchester Hotel.

And is it true,
This most tremendous tale of all,
Seen in a stained-glass window’s hue,
A Baby in an ox’s stall ?
The Maker of the stars and sea
Become a Child on earth for me ?

And is it true? For if it is,
No loving fingers tying strings
Around those tissued fripperies,
The sweet and silly Christmas things,
Bath salts and inexpensive scent
And hideous tie so kindly meant,

No love that in a family dwells,
No carolling in frosty air,
Nor all the steeple-shaking bells
Can with this single Truth compare -
That God was man in Palestine
And lives today in Bread and Wine.

-John Betjeman

Merry Christmas, and a happy New Year!

It’s silly season at work. There are two every year. In the summer, the place is quiet because the staff with children take the opportunity to go on two-week summer holidays. Nothing gets done, so you can plan ahead and get a stack of things ready to do then.

It’s a good time to work in isolation, not least because no emails you send or voicemail messages you leave are going to be answered for a while. Get used to finding things to do.

It was even worse when I worked for a large Anglo-Swedish pharmaceutical manufacturer. Sweden is heavily unionised, and the entire country effectively went on holiday for six weeks in the Summer. Completely ludicrous, but the third rail of management was trying to do something about it, so it went unspoken. Half the firm ground to a halt over the summer. The other half, of course, was in America, and they thought they were running the show.

Christmas is the other quiet time, when virtually everyone takes holiday. That seems really silly to me, becuase there’s quiet often nothing to do for those left in the office. Most people are there on production support, but their users are away drinking mulled wine at home. The others take long lunches and work short hours, which, to my mind, makes it a great time to be at my desk.

Whilst I’ve got all this time, I’m trying to learn New Things. I’m brushing up on my C++, and trying my hand (again) at Python. I bought the O’Reilly book years ago and never read it, and I’ve just installed the fantasic IronPython Studio, so now is a perfect time to give it another go.

Here’s a list of things to do:

  • Tidy up your project website.
  • Comment your public API.
  • Clean up your source control repository.
  • Arrange your stationary in reverse order of size.
  • Learn a new programming language
  • Learn the double-checked locking pattern
  • Learn about exception safety
  • Learn erlang.

It’s a common theme (at least in the UK) that people bemoan the passing of ‘institutions’ like Woolies, yet never went and bought anything when it was open.

We saw this over the last decade with small high-street shops going under whilst superstores and chain retailers survived, because they were able to use their colossal buying power to force suppliers to drop their prices.

Only recently have the public seen the error of their ways, and buying organic is now in vogue.

Woolworths was the first of the buy ‘em high, sell ‘em cheap retailers. The proprieter apparently had to put up signs to the effect that prices were fixed, and staff weren’t allowed to negotiate. Apparently customers were used to haggling over the price of their Fairy Liquid.

Similarly, since most goods were either 3d or 6d (thru’pence or sixpence, respectively), the registers (such as they were) were programmed to only accept multiples of 3d – if you wanted a penny chew, you either had to have three, or lose out on tu’pence.

It seems harsh, but businesses aren’t owed a market, and Woolworths lost its way a while back.

In C++, you can have a static variable defined in a function – scoped to the block, and with no linkage, but with a lifetime that extends from the first instantiation to the end of the program, unlike an auto. You’re not allowed this in C# – why not?

Well first of all, is it a good idea?

Static is one of the most overused and poorly understood keywords in the programming language ecosystem. In C++ alone it has at least five meanings – as a modifier affecting duration and linkage, orthogonally. It gets worse, because it was then co-opted to mean ‘determined at compile time rather than at runtime’.

In C++ static locals are commonly used as reference counters – initialise the counter once and increment it each time the function’s called. This can be replicated in C# by moving the static variable to class scope, but that feels like it breaks encapsulation.

Does it? No, it doesn’t. In OO, functions were never meant to contain data, only to expose and mutate it. A class or a struct is a container of data, so the class level is exactly the right place for your static.

Further, their use is actively dangerous, for reasons that aren’t immediately obvious. Functions with static locals are implemented with a hidden static boolean variable representing the initialisation state of the variable in question, as well as some simple code to check the state and instantiate it once. Predictably, this code itself isn’t thread safe. This issue is discussed at length in this codeguru article.

So, static locals aren’t really a very good idea in an OO environment, and also lull the unknowing developer into a false sense of security. Sounds like a bad candidate for a language feature to me!

Anders Hejlsberg didn’t take up my suggestions for new language features in C# 4.0, damn him. Instead we’re stuck with the moronic dynamic, a nod of the head towards stupidity and indolence.

The idea is that it’ll be easier to do some things which are currently fairly difficult, like interop with COM, and with dynamic languages like IronPython and IronRuby. In actual fact, the huge hidden cost is runtime initialisation of the whole DLR, which is not insignificant.

I quite admire the DLR, although (again) Microsoft have taken all the credit for clever techniques which are, in actual fact, quite old. Watch them do the same with HPC, MPI, and hosted applications (the cloud, whatever that means).

I won’t start a tirade about dynamic languages – they are what they are. But let’s not confuse ourselves: the words dynamic and huge runtime cost should be seared onto a developers’ mind next to each other. Any value whose type can’t be determined at compile time must, by definition, be determined at runtime. A compiler’s raison d’etre is to defer that cost – so beware, if you value productivity over speed of execution.

I still hold out hope for language support for ad-hoc tuples, although there are certainly strong arguments against their use. Members are anonymous, so they make a public API  confusing. There are constructs for structured data already – the clue’s in the name. The language is already big and convoluted, and there are other .NET languages that support them – C# shouldn’t be a panacea.

Get rid of var – that’d be the best thing. Or restrict its use so that lazy developers can’t use it to replace string or (why?!) int.

I’ve been to the opera two or three times, and always enjoyed it. When I was a student in Manchester we saw the Chisinau National Opera perform Tosca, and fell in love with the wonderful sacristan in the first act. Afterwards we’d walk up Peter St and past the Midland Hotel to Oxford St and the tiny Temple Bar, with the best dukebox in the city and a martini to knock your socks off.

I’ve seen the Prague State Opera at their glorious house at the top of the City, which has had its fair share of drama. In the 1940’s the Nazis used the opera house for rallies. Czechoslovakia got a bad deal in the war; forced to give up the Sudetenland, they were sort of left to fend for themselves, and one feels quite sorry for them.

In 1989 students demonstrated in the square in front of the adjacent Town Hall – perestroika and glasnost were four years old, yet it took a week of struggle to show the communist leaders that the writing was on the wall. Now there’s a MacDonald’s in Wenceslas Square, which should make it quite clear.

They sang Nabucco in Italian (of course!), with Czech surtitles, so my (then) girlfriend and I were quite lost. Heads turned as I hummed along to the Chorus of the Hebrew Slaves, and we gasped appropriately as God Himself appeared. It was Awesome.

I’ve been to New York three times, and haven’t once been to the Met. When, last night, I saw a poster for live performances, via sattelite, of Met Operas at the BFI Imax on the South bank of the Thames, I thought it’d be a lovely thing to do just after New Years’. But they’re selling the good tickets for £25 a shot, and with prices like that I’d rather see the real thing.