Tag Archive: programming


This is a (very belated) response to Joel Spolsky’s article about giving programmers separate offices.

I strongly beleive that communication is good, especially when you have new team members unfamiliar with the inner workings and coding style of a large and mature system. If I’m new on a team, or in a company, and ask a question of a real developer I work with, they might realise that I’m asking the wrong question (c.f. Raymond Chen’s regular advice about people asking the wrong question – for example here, here and here) – if I search Google I’ll find the answer, but I might fundamentally be going down the wrong tack. This will cause even more lost time down the line as subtle, hard-to-find bugs have been introduced.

StackOverflow is littered with people asking a specific question (‘How do I achieve blah in Javascript?’) with answers that say ‘You can do it like this, but why not just do it in CSS instead?’ or similar. It’s very easy to think yourself into a hole while programming and not notice or realise that you’re going down the wrong path (not to mix metaphors too hideously). By speaking to a real person they are much more likely than a web search to say ‘hang on, why would you want to do that?’

As a response to the Joel’s argument that a huge amount of time is wasted by a simple request I’d say if you work sensibly that shouldn’t be a huge problem; if you make notes as you go along, and ask people to wait while you tie up loose ends before asking you something then there’s no reason to lose very much time at all by leaving ‘the zone’. I don’t personally know of any developers who go into some kind of zen trance while programming, or whose eyes turn white – a short question shouldn’t ever disturb your mental stack too egregiously.

I say far better to foster an environment where everyone feels free to ask questions of others and is happy to answer others’ questions. Programmers are introverted enough as it is!

Mark

I don’t have as much time today to write a full post, so I’ll take the easy way out and give a smattering of links I’ve enjoyed recently.

Fabulous Adventures in Coding – Making the code read like the spec

Eric Lippert is probably my favourite computer science blogger (even narowly beating the mighty Joel Spolsky) as not only do his interests in language design and linguistics intersect quite nicely with mine but he manages explains very complex topics in incredibly clear and concise ways, and still have the odd humourous side comment. If you’re not a software engineer and don’t care about identifying cycles in type hierarchies then just read the following few paragraphs:

First off, what is this thing called the “reflexive and transitive closure”?

Consider a “relation” – a function that takes two things and returns a Boolean[1] that tells you whether the relation holds. A relation, call it ~>, is reflexive if X~>X is true for every X. It is symmetric if A~>B necessarily implies that B~>A. And it is transitive if A~>B and B~>C necessarily implies that A~>C.

For example, the relation “less than or equal to” on integers is reflexive: X≤X is true for all X. It is not symmetric: 1≤2 is true, but 2≤1 is false. And it is transitive: if A≤B and B≤C then it is necessarily true that A≤C.

The relation “is equal to” is reflexive, symmetric and transitive; a relation with all three properties is said to be an “equivalence relation” because it allows you to partition a set into mutually-exclusive “equivalence classes”.

The relation “is the parent of” on people is not reflexive: no one is their own parent. It is not symmetric: if A is the parent of B, then B is not the parent of A. And it is not transitive: if A is the parent of B and B is the parent of C, then A is not the parent of C. (Rather, A is the grandparent of C.)

It is possible to take a nontransitive relation like “is the parent of” and from it produce a transitive relation. Basically, we simply make up a new relation that is exactly the same as the parent relation, except that we enforce that it be transitive. This is the “is the ancestor of” relation: if A is the ancestor of B, and B is the ancestor of C, then A is necessarily the ancestor of C. The “ancestor” relation is said to be the transitive closure of the “parent” relation.

I think that’s about as clear and concise way to define closures over relations anyone can write. If you really want your brain to flip then read his series of articles on covariance and contra-variance – mind blowing. Or if you want a bit of lighter relief, read his rants

Sceince, Reason and Critical Thought – Skeptic Park

Since learning about the BCA v Singh case through the authoritative Jack of Kent’s blog I’ve become rather too obsessed with skepticism/liberlism – I haven’t changed my political thinking very much (maybe moved from just right of centre to just left) but these writers seem to speak the same language as me and argue things I generally agree with, so I’m happy to stand under their metaphorical collective banner. Crispian Jago’s blog is the light relief in the crowd – in one video he wagers that ‘if homeopathy works I’ll drink my own piss’ and then proceeds to prepare a homeopathic solution from said urine and drink the result. Genius.

In the above linked cartoon he turns well known skeptics into South Park characters. Have an explore around his site for more gems.

Charlie Brooker – Christmas is the season of awful adverts

An article from a real newspaper – the Grauniad Guardian. As is all too well known to anyone who knows me, I’m quite a fan of Mr. Brooker, and I think this stands as one of his best rants. Particularly the following:

Watching Marks and Spencer’s Christmas ad is like sitting through Children in Need. Joanna Lumley, Stephen Fry, Myleene Klass, Jennifer Saunders, Twiggy, James Nesbitt, Wallace and Gromit . . . it’s so chummy and cosy and thoroughly delighted by its own existence, I keep hoping it’ll suddenly cut to a shot of a deranged crystal meth user squatting on the cold stone floor of a disused garage, screaming about serpents while feverishly sawing their own hand off at the wrist.Instead it jokily tries to undercut itself by including a cameo from Philip Glenister, standing in a pub to prove what a bumptiously down-to-earth Mr Bloke he is. His job is to stand at the bar claiming that the best thing about Christmas is the sexy girl from the Marks and Sparks ads running around in her knickers. Then it cuts to the sexy girl from the Marks and Sparks ads running around in her knickers, as though this is somehow as iconic a Christmas image as Rudolph’s nose or the little baby Jesus. Listen here, M&S: few things in life are more pukesome and hollow than a self-mythologising advert – so next year do us all a favour and just shake a few sleighbells, flog us some pants, and then piss off back to your smug little shop and be quiet.

Classic.

Enemies of Reason – My parcel hell

Another rant to be finishing off with, this time from Anton Vowl (who’s catchphrase should really be ‘reading the grotty, seedy newspapers so you don’t have to.’) – an angry, angry man. For extra comic value try reading his diatribe on getting parcels delivered in the style of Christian Bale’s famous shouty-fest[2]:

You tried? Oh good for you. What do you want – a fucking round of applause? How about I whine to you about a series of unsuccessful ‘attempts’ to pay you the money I owe you?

Proper service should be resumed tomorrow.

Mark

  1. [A Boolean is a true or false variable - Mark] []
  2. On that topic wathc this. It’s brilliant:

    []

Polemic time again. One facet of advertising which profoundly annoys me (and there are many facets of advertising which profoundly annoy me) are adverts where the advertisers act as if the thing they wish were happening were actually happening. ‘Oh, I wish people were so excited by our new range of loo scrubbers that they held celebratory parties in the street and in years to come related with teary eyes to their grandchildren the magical day when the new Bigger Better Bog Brush bounded into their lives!’ is what I imagine they say in their trendy Soho offices. And so in a masterstroke of public wankery they shoot an advert where people are giving up their first-born children for a chance to own one of their poxy new products.

Don’t get me wrong, passion about what you’re selling is entirely admirable, and it’s right that some pride in your products should come across in an advert; my problem is when advertisers try to shoe-horn in an emotional response to a product where no such response previously existed. It’s not sexy just because you tell me it is.

I won’t reveal which major technology company a while ago sent me an advert for an upcoming developer’s conference on the use of their technologies which had the following strap-line:

Get ready. It’s almost here. The free techie party that everyone talks about and no one misses because hey, you do not want to miss out on this kind of learning and fun!

Wow, that’s some pretty bold claims; ‘no one misses’ it, apparently. It’s a ‘party’ of ‘learning and fun’[1].

Let’s be honest, no one will find a programming conference on Delphi unnamed coding tool fun, unless they’re an imbecile. However, despite the patent lack of fun, many people might yet be interested in attending; on the more visceral end of the scale, those whose livelihoods depend on advance use of these technologies will be very interested to learn of a (free, by the way) conference on how better to use them, on the other hand the basic satisfaction of intellectual curiosity is something which many people actively seek. It’s rather churlish to describe such pursuits as ‘fun’ – is watching the news ‘fun’?; reading a history book?; engaging in a robust debate on religion? No, I would argue, it’s not ‘fun’, but it doesn’t have to be – it’s enough to be intellectually stimulated and emerge from the experience more knowledgable and mentally enriched.

By all means advertise in passionate terms what this conference will provide, but be honest – don’t try to pretend it’s going to be a rip-roaring ride of fun, it’s insulting to the intelligence.

In a similar vein, though with a very different agenda, a few years ago the UK government (I would guess through it’s touchy-feely ‘DirectGov’ money sink nebulous concept – don’t get me started on the execrable  ‘I’d Go Direct Guv’ advert) launched an advertising campaign to convince teenagers that unprotected sex is irresponsible and likely to fuck up your life (which I think few would disagree with). Now they could have chosen a number of approaches to achieve this aim; perhaps they could have used a stern authority figure to proclaim the dangers of ‘going commando into the pink jungle’, or they could have used talking heads of those of their peers who have met with the nasty consequences of ‘riding the Indian train‘ as a shock cautionary tale of the dangers. But no, they made a series of adverts which depicted what the government dearly wished were true; they had a bunch of teenagers acting like unprotected sex was uncool, and you’d be ostracised if you dared go in unsheathed:

Haha, they’ve put him in goal because he didn’t use a condom – it’s funny cos it’s not true[2]. Now while there are a great number of teenagers who do know the dangers of unprotected sex and would always use a condom, they are not who this advert is aimed at. The people it’s aimed at would, by definition, never be having that conversation. Does the government really think that those teenagers will see that advert and think ‘God, that must be what everyone else at school is really thinking, I’d better start using a condom – I don’t want to play in goal!’[3]. Very few people are that stupid or gullible. It’s not cool just because you tell me it is.

Till tomorrow, I hope.

Mark

  1. I’m somehow reminded of the Complaints department of The Sirius Cybernetics Corporation – ‘Share and Enjoy!’ []
  2. There is a joke in there somewhere about David Seamen but I can’t find it at the moment []
  3. Releasing their inner Seamen if you will (found it!). []
Powered by WordPress and Motion by 85ideas.