Category Archives: Uncategorized

Where I go find Go is like Go

I’ve been playing with Go recently; writing a little REST server that will do some stuff on hitting various end points. So far so copy-and-paste-from-Stack-Overflow. The issue is that, while my application works, I know at a visceral level that it sucks. I’m using go run to test it, and everything is lumped into one file. As an experienced developer I know this is bad – and it’s going to get worse.

And herein lies the problem. Architecturally I know what I should be doing, but as a Go newbie I don’t know if I should be splitting my file into many files in the main package, or splitting it into lots of little single file libraries, or something else entirely. I’ve picked up the syntax of the language, but the paradigms and idiosyncrasies are still, for the most part, unknown to me.

Remove the architectural knowledge that a few decades bashing away at various languages has given me and what you’re left with is a program that compiles, runs and does some nifty stuff – so it must be good, right? Look at me, I’m a Go developer!

I’m all for teaching people about how computers work, and the fundamentals of programming them, but lets not kid ourselves that we’re raising a generation of software engineers. There’s a world of difference between barfing a small, toy project into existence and writing performant, fault tolerant, scalable software that can drive business. Seriously, if I’d presented what I wrote yesterday as some production code I’d fire me. And yet too many people out there don’t know that they don’t know how to be a software developer.

Sadly, I have no idea what the solution is. Computers are fairly ubiquitous, learning to code is easy, and putting together need little programs that, on the surface of it, look impressive, is reasonably trivial. A good parallel would be the game ‘go‘. It’s trivial to pick up and learn, but takes a lifetime to master.

Now, do I know any friendly Go developers who would be willing to give a gentle code review of some truly awful code? Now that I’ve learned Go I need to learn Go.

The Eureka Moment

Hollywood is full of tropes, significant and recurring themes that are used for everything from character development to plot advancement. For example, in almost every film where the protagonist is trying to solve a problem there is some seemingly unconnected event that triggers their working out the answer. The “Eureka!” moment is so prevalent it’s getting hackneyed. And yet it’s not as far fetched as it sometimes seems.

Software developers are well aware of how solutions to problems will often come to them at bizarre times. Sometime you just wake up with the answer. Sometimes it pops into your head while taking a walk, or having a shower. In fact, this is so common that at Rainbird we actively encourage people to go for a walk when they’re stuck.

But this isn’t the seemingly unconnected event. This is just giving your brain the space to work on the issue almost subconsciously. Sometimes, however, the mind does need something to prod it in the right direction.

This weekend I was at Wroxham Barns with my family. The children’s menu there has activities on the back to keep small people occupied while they wait for their food. It’s a fairly standard practice at child friendly venues and often gives parents a chance to hone their colouring skills under the close supervision of their children – at least that’s what happens in our family.

In this particular case I was helping Willow, my eldest, to do the maze. I was also using it as an opportunity to start teaching her fairly basic pathing algorithms. We would draw a line to a junction, then check each possible route for dead ends. Since it was a fairly basic maze I could easily check ahead and guide Willow so that we only started drawing again when each incorrect direction has been investigated and discounted.

At one point the maze got a little more complex, with me having to hold a number of junctions in my head and effectively build a tree of routes which we could then go and explore. Not only that, but there were actually multiple routes through the maze. Jokingly I started talking about Dijkstra’s algorithm and A*, knowing full well that we were already well beyond the attention span of a three year old.

Far from being a pointless and throwaway conversation with a small child, the event actually linked two disparate bits of information that had been floating around my head for weeks now. You see, I’ve been trying to move more of Rainbird into the graph to simplify our inference algorithm. I believe I now have the core structure of the graph correct, and have been thinking through how inference would work within this structure.

My working hypothesis was that the answer starts as a linear goal and expands to be a tree as the solution is sought. But there’s a problem with this. For complex Knowledge Maps the tree can get very large very quickly. There is a performance concern here.

Sitting there, messing about with this maze and trying to explain pathing algorithms to a toddler I suddenly realised that the solution isn’t a tree, it’s a directed acyclic graph with multiple paths through some parts. I could collapse large parts of very complex trees, seek multiple routes through the graph at once, and handle complexities such as salience that I hadn’t even considered yet.

Sadly this isn’t Hollywood, and I didn’t get to just run off an implement the solution. I had to continue entertaining the child until lunch came and wait until we were back in the car home before I could jot down some notes. I also won’t be able to code up the solution in a single sitting with beautiful, bug free code that works first time. Instead I get to test my new hypothesis on paper, see if it works, and then slowly integrate it into the existing codebase over the coming months.

So yes, the eureka moment isn’t that far fetched. It’s just everything that happens around it that is.

A Troubling Trend

Yesterday I gave 4 lessons1 to 4 different year groups at my local secondary school. The lessons were on IT in general, and covered Ariane 501. Ariane 501 is a great case study for how a trivial oversight in software can cause a catastrophic failure, but it’s also quite a complex subject. You really need an appreciation of binary and integer overflows, and a familiarity with programming, especially Ada, helps. I usually do the talk for university students and above.

Given I had absolutely no expectation of secondary school kids knowing about integer overflows and Ada, or indeed any programming beyond Scratch and maybe Python, I took it back to basics and disguised learning about binary and bytes as ‘fun’ by wrapping it in rockets going boom. It seemed to work well.

I did, however, notice a troubling trend.

The year 72 group were hugely engaged, with the whole group (boys and girls) actively answering and asking questions. One girl even managed to work out what went wrong with Ariane 501 five minutes into that part of the talk. I was seriously impressed.

As you go up through the year groups the engagement reduced. This was expected; as the kids get older they get more self conscious – and this doesn’t stop at childhood, we adults are just as guilty. What wasn’t expected was the difference in engagement between the girls and the boys.

With year 7 the split was almost equal, 50/50 girls and boys answering, and asking the questions. By year 103 I’d guess only 10% of the hands were girls. And yet they knew the answers. One girl, who had been separated from the group for being disruptive at the beginning of the class, was whispering the answers to herself, and was getting them all right.

It saddens me to think that in 4 years a 7 year old, who practically left me speechless with her powers of observation and deduction will, for some unfathomable reason, likely also be whispering the answers before giving up on tech for good.


1 I’ve been giving a lot of talks of late which is part of the reason I’ve not been blogging so much. My usual blogging time has been taken over by me trying to get all my prep done in time.

2 Aged 11-12

3 Aged 14-15

Shit happens

Shit happens. It’s a given. Anyone who tells you otherwise is either lying, or trying to sell you something. The difference is how you deal with it, and also how those around you deal with it.

I needed to take a day off work today. The timing is appalling, but couldn’t be helped. Shit happens, you don’t get to control when or where. Now, I’ve worked at various places and I think its fair to say that all of them would have let me have today off1, however most of them would have come with guilt, or assurances of being contactable, or some other way of letting you know that this was being done grudgingly and that you should somehow be happy about it.

Thankfully the attitude is very different at Rainbird. We are there because we want to be there. If I can’t be there today, I can’t be there. Simple as. They’ll manage (and they did). My request for a day off was met with “Absolutely, go, we’ll sort something out”. No guilt, no power plays, just understanding and accommodation.

This is, as far as I’m concerned, the only attitude you can have. Shit happens, and you have no control over what, or where or when. Sometimes people can’t make it into work, for whatever reason, and you just need to deal with it. This bullshit attitude of presenteeism that seems to be going around isn’t helpful. Engaged and motivated employees will actively want to be at work If they’re not, it’s not because they’re slacking off, It’s because they can’t be, or their presence won’t contribute anything, or because turning up may actually be detrimental to others.

I’ve had flu – actual proper flu, not Manflu – twice. It’s hideous. My first bout was caught from a manager who came back from the Far East with Hong Kong Flu; you know, the variant that was in the news for killing people around the turn of the millennium. He decided he was far too important to be at home ill, so came into the office and had meetings with people to “catch up”. He wiped out the majority of the team for about 2 weeks. The damage his few hours in the office caused could easily be measured in man months. The kicker is that all the meetings could have been done by phone; or even handled by subordinates and peers.

I’ve even once had the misfortune to be speaking to one pretentious prick who actually used the words “He better be dead or dying” to describe the acceptable set of circumstances I could give for a colleague and close friend not being in the office that day. Being able to deliver the news that said colleague was in fact killed in a paragliding accident the previous week yielded little more than demands for who was going to take over the project. I hung up on the guy.

The fact of the matter is that no one is indispensable, and if they are then it’s your fault for letting them get to that situation. If an engaged and motivated employee can’t work on a day, it’s because they can’t work that day. If an unengaged and disgruntled employee is so critical to operations that you can’t have them out under any circumstances then you’re already stuffed.


1 I know people who have worked at places that would have denied a holiday request for this