Coding with Honour

The personal blog of Sam Stokes.

What Programming Is Like

| Comments

What is programming like?

We in the software profession have done a terrible job of explaining to the public what it is that we do. Everyone has interacted with a teacher or a doctor. There are TV shows about lawyers, cops, even government officials. However warped our impression of their day-to-day, we can relate to these professions. TV depicts programmers as modern-day wizards, socially aloof, hacking into systems or bringing the new algorithm online just in time to stop the cyberterrorists — totally disconnected from people’s experience of the software they use every day. Software remains mysterious.

This isn’t just a problem for awkward “so, what do you do?” conversations at parties. I believe one reason why so many demographics are underrepresented in software is that unless you grew up with it, you’re unlikely to have the faintest idea what making software is actually like. Why would you strive — particularly against economic obstacles and systemic biases — to enter a profession you know nothing about?

Programming sucks

Inspired by a friend who couldn’t see what was so hard about programming, Peter Welch wrote a hilarious, heartfelt and all-too-true rant about what writing software is like. His title, and answer: “Programming Sucks”. The whole, long post is enjoyable reading, but here’s a representative excerpt:

Imagine joining an engineering team […] for a bridge in a major metropolitan area. […] The bridge was designed as a suspension bridge, but nobody actually knew how to build a suspension bridge, so they got halfway through it and then just added extra support columns to keep the thing standing, but they left the suspension cables because they’re still sort of holding up parts of the bridge. Nobody knows which parts, but everybody’s pretty sure they’re important parts. […]

Would you drive across this bridge? No. If it somehow got built, everybody involved would be executed. Yet some version of this dynamic wrote every single program you have ever used, banking software, websites, and a ubiquitously used program that was supposed to protect information on the internet but didn’t.

Vim Wizardry #1

| Comments

(I wrote this as a response to an Ask Hacker News post about learning Vim, but I thought it deserved a life of its own.)

This is one of my favourite Vim features. Say you have the following code:

1
2
do_something_with(some + long * complicated * expression)
                           ^

Say your cursor is where the caret indicates. Typing ci) (“change inside parens”) in normal mode will:

  • delete all the text between the two matching parens
  • place you in insert mode with the cursor between the two (now adjacent) parens
  • put the deleted text in the yank buffer so that p will paste it.

The use case here is obviously so you can assign a name to that long complicated expression. ci) is much easier than selecting it with the mouse, and keeps your hands on the keyboard where they belong ;)

The Genesis of a Building

| Comments

Witnessing this is pretty cool from a “making things” point of view. Shame it’s happening right outside our flat.

Limerick Lisp-style

| Comments

In honour of the Functional Programming eXchange, on a bus to which I am writing this.

 (a (program (writtenp :in 'lisp))
     (may 'be (and (simple) (elegant) (crisp)))
     (but (cry '(C pros) "too *fancy();"
             "for (i; simply(); &cant++ + ++see)"
             "{ the code; for (;;) { the parenthesis; } }")))

Why the Digital Economy Bill Is Flawed

| Comments

My MP, Meg Hillier, was kind enough to respond by post to my email about the proposed “three strikes” legislation in the UK. The main content of her response was to forward me a letter she received from Stephen Timms, the Minister for Digital Britain (his actual job title, I’m not making this up), to “clarify the Government’s position on this issue”.

The forwarded letter mostly just rattled off the party line - illegal file sharing is illegal, artists need to be compensated, the usual unjustified claims of urgency - but it did mention the recent report by the UK Intellectual Property Office, awkwardly entitled © The Way Ahead, which is actually pretty encouraging reading: I will discuss it in a separate post soon.

My previous email focused on problems with the “three strikes” approach. Since the Digital Economy Bill was published we’ve discovered that “three strikes” is only one of several nasty tricks up Mandy’s sleeve. Therefore, and because I felt from her letter that Ms Hillier hadn’t really taken my concerns on board, I wrote back.