The stupidest thing I ever saw a developer do

So this story comes up quite a lot – this is the stupidest thing I ever saw a developer do. I need to paraphrase a little because it’s been many years, but in a nutshell we’d had a new guy start as a junior developer and he was working through bug tickets, with instruction to run solutions past another developer prior to checking them in. He was dealing with an issue where the backtrace read something like this:

undefined method `capitalize' for nil:NilClass (NoMethodError)

Which is a relatively simple exception to explain and is probably, in my experience, the most common backtrace a developer will ever see. It usually means that someone has not coded defensively, or that something has been coupled to something else in a non-obvious way and someone didn’t realise. You can easily achieve the error yourself:

my_hash = {}

Anyway, after working on it for a few hours our developer came to me with his solution. Here is what he had done:

class NilClass
  def method_missing(method_sym, *arguments, &block)

For non-rubyists, here is a translation of what that bit of code does:

Let’s change the meaning of nothing, so that whenever someone tries to do something to nothing, we just do nothing.

I am not entirely proud of my reaction at the time, which was basically to laugh at the guy, tell pretty much everyone in the office about what he’d done, and then continue to tell the story for many years to come. To his credit, this “fix” had actually, to the untrained eye, fixed the problem because the software was now behaving as expected.

Evidently, the developer in question had, upon seeing the backtrace, Googled it. He had found a stackoverflow entry where someone else was having the same issue and some helpful user had submitted the NilClass monkey patch as a joke answer to the question. Other helpful users had up-voted this answer, which lead to our guy not identifying it as a joke.

I tried in vain to track down a link to this stackoverflow entry (it was many years ago) but to no avail.

Like I said, I tell this story quite a lot – the most recent time was earlier on today in fact, and it got me thinking. I worked through  the steps that this particular developer had taken:

  • He googled the error
  • He found a “solution”
  • Without understanding it, he stuck it in the codebase

And it dawned upon me that maybe I had been a little harsh on the guy, because that little trio of bullet points right there is one I have followed a whole bunch of times myself, especially when I was first getting started as a dev.

I never had a mentor, and regularly found myself being completely out of my depth and being asked to do things which I had no idea how to do. It was scary, it was stressful, and whilst being pushed in the deep end does make you very good very quickly (provided you swim) it can lead to you becoming overly reliant on the internet for solutions. You become adept at “skimming over documentation”. It’s bad practice.

If this story feels kind of familiar to you, then know that you are not alone – almost every programmer I have ever worked with has at some point engaged in “stackoverflow driven development” . Nowadays I always try to be aware of what I do not know – Taking time to properly understand what a solution means is not wasted time.

And if the guy who I laughed at ever reads this, please consider this an apology.


Interactive fiction – a primer

Okay so I’ve just finished my first interactive fiction, The Scarecrow. I wouldn’t say this was enough for me to call myself an “interactive fiction author” and I certainly wouldn’t call myself a writer (seriously, I’m just this computer nerd from Birmingham!) but I do see it as being a bit of a milestone for me as I’ve been a fan of this genre of writing for some years now. There is a chance that through these posts, some of my friends and followers may have become interested in the genre and so I’m making this post just to give any potential fans a gentle nudge in the right direction.

There’s loads of guide online about how to get an interpreter set up, so I won’t go through that here I’ll just link to this.

In terms of authors – the landscape is pretty rich… it would be dismissive of me to just point you straight in the direction of “the ones you gotta read”, so all I’ll say is that my favorites are Emily Short and Andrew Plotkin. We’ll leave it at that.

The other thing to understand is that these days, the factor that seperates the dogs from the puppies is *quality*. Given that these works are mostly free, that means you have a whole wealth of quality literature right there and readily available, provided by a community who would be delighted if you read and enjoyed their works.

In terms of where to find good IF, this is the joint right here. Either that or a good google search.

Annually, the IF community hold a competition in the month of September (one I hope to take part in next year). The quality is always very high in the competition, this years entries should be appearing here soon. Previous years entries are also available for download from the IF database.

Anyway, hopefully this should be enough to get people started if they’re interested. Peace out \m/

The scarecrow is finished!

My first interactive fiction, “the scarecrow”, is now live for you guys to try out.

Hopefully you’ll enjoy it – the intention here was never to write a great work of fiction, it was initially just to learn the platform… but as I started to build the world I got quite attached to it so quite a lot of care has gone into this. I think enough scene-setting has already been discussed in previous posts, but in my opinion here is how best to experience this story:

1) Grab a nice big glass of red wine

2) Curl up on a couch or some other comfortable place. Dim the lights.

3) Stare at this painting by John Constable


4) Imagine the scene in the painting decaying into a rotten, barren landscape.

If by this point you want to know what is in that cottage, click this link and enjoy 🙂

Feedback is most welcome, particularly if you find yourself getting annoyed or stuck (something I’ve tried very hard to avoid happening). An entire playthrough should take around 20-30 minutes.

Edit: Just in case anyone hasn’t played IF before – remember to examine everything, and if you get lost you can “look” to see what’s around you.

Playtesting interactive fiction is TOUGH!

The IF I’m working on currently clocks in at just over 3500 words, and I’ve been writing it in a linear fashion meaning the first part of the story became playable about a week ago. With typical ill-placed optimism I’ve spent the last week testing it out on various people and have come to the following conclusion: If you present someone with a fantasy setting and ask them “what would you like to do?”, they’re going to say something ridiculous 🙂 And we totally had a laugh too – between lying down in the mud, sitting on a plough in the rain and performing unspeakable acts on a roaming cat, it was a total hoot but it didn’t get me any closer to any decent feedback.

So this is an open plea to anyone who is interested: The first 10 minutes or so of the scarecrow is online now. If anyone would like the link, get in touch. Here are the things I could do with help on;

  • General feedback on the world, is it described well enough (or, too much).
  • General feedback on the system itself. Did you try examining things that weren’t there? Did you type in commands that the interpreter didn’t understand but that you thought were totally valid.
  • Help on ideas for puzzles and texture. Possibly involving a pub lunch / day to brainstorm.

The other thing: If you are genuinely interested in reading / playing through the story, you probably don’t want to be involved in playtesting. Basically, I do need the help, but having been working on this for a few weeks I am totally sick to death of reading the same sentences over and over! This is partly why I need assistance (I can’t tell what’s good or bad any more because I’m too close to it) but equally you should probably bear in mind that if you do help me test/develop, it’ll wreck it for you too.

Anyway, I’ll leave you to mull that over. Cheerio for now!

The Scarecrow

This is just a quick post to introduce an interactive fiction I’m working on at the moment. It’s called “The Scarecrow” and is a short horror story set in Suffolk a few years after the end of the Napoleonic wars. You play the part of a nameless traveller with a mysterious past who happens upon an isolated cottage. As the traveller explores the surreal landscape they realise that not everything is as it seems. The story itself will explore themes of isolation (both literal and perceived) and whether or not someone can truly enjoy calm in the wake of a storm.

The setting is inspired by this painting by John Constable;


With additional inspiration being drawn from Frankenstein, HP Lovecraft and Slaughterhouse Five (I also realised that I have unintentionally poached quite a lot of ideas from “A harvesting Moon” by Michael White) . I am writing this mainly to explore and learn the Z-Code platform but also to attract the attention of some of my writer friends who I would like to collaborate with (hello if you’re listening!)

I don’t know when this will be done as creative writing is not something that comes particularly naturally to me (and there’s quite a lot of research involved because I know nothing about nineteenth century agriculture either – yet!) but the coding is well underway and I’m hoping to get it published within the next few months.

Here’s a sneak peek of the intro;

“In the winter of 1815, after countless millions had perished, the Napoleonic Wars came to an end. The little corporal Napoleon Bonaparte, emperor of France for the decade previous, was exiled to the volcanic island of St Helena where he would see out the last six years of his life.

The end of the Napoleonic wars saw the start of a great agricultural depression in the United Kingdom that would last for a quarter of a century. Many farms succumbed to abandonment and disrepair as both landlords and tenants fell into bankruptcy.

It is in the wake of this ruin, far from the bloody fields of Waterloo and Rocquencourt, that you find yourself standing on a long farm road in Suffolk, surrounded by fields of oat and barley. Save for the carrion crow circling above, a dull lifelessness hangs in the air like mist and you feel your heart mourning for the rural paradise now lost to time and neglect.

Five hundred miles away, in seemingly unrelated events, a young author called Mary Shelley has finished writing her first novel, ‘The Modern Prometheus’…”

I’ve felt dead creatively for so long now, and starting this has woken up that side of my brain. More updates soon!

Bubblr – JQuery bubbles plugin

The bubblr JQuery plugin allows you to add a bubbling animations to any canvas element. It allows you to specify options such as the number of bubbles, the colour/background colour of the canvas (including “transparent”) and the size of the bubbles.

Static screenshot of the bubbles in action

Applications for this plugin include;

  • Add lifelike movement to elements such as drinks, fish tanks and aquatic scenes.
  • Create other particle effects such as smoke, fire and starship warp cores.
  • Send your users into a hypnotic trance – nobody can resist the power of bubblr!
  • Works on all HTML5 compatible browsers, including both robot and fruit-based tablets and phones.

Full source code is available for download here:

Demo of bubbr-y goodness available here:

Licensed under GPL and MIT.

Passing the time in Tanzania

Just got back today from a life changing holiday in Tanzania. Lots of long road trips to get to the various regions, and here’s how we passed the time 🙂

The game is “Africa Films” (or #africafilms if you like!) and these are our greatest hits.

  • Educating Cheetah
  • Beauty and the Wildebeast
  • Hyena Noon
  • Hang ’em Hyrax
  • The Impala Strikes Back
  • Fight Cub
  • Honey badger, i shrunk the kids
  • Bulletproof Monkey
  • Elephantasia
  • Star Trek 2: Giraffe of Kahn
  • Man in the lion mask
  • Snow White and the seven Dwarf Mongooses
  • Dik-dik Tracy
  • Eland before time
  • Lovebirds Actually (with Hugh Grant-gazelle and Emma Thomson-gazelle)
  • Blue Vervet
  • Look who’s storking
  • Serengettysburg
  • Arusha Hour
  • Warthog Day
  • Memoirs of Acacia

Anyone who has any other suggestions, feel free to submit them in the comments 🙂