The Fun Will Never End, It’s Spaghetti Time!

After completing my first year of university at UWE studying BSc Computing, I started my summer break. I came to the sudden realisation that I had 4 months ahead of me before I started my second year. After previously spending 10 years working full-time, having this vast amount of free time suddenly thrown at me seemed like a dream; but after spending a week lazing about in my underpants, the novelty soon wore off. I became bored. Very bored.

The year before I had been gifted a Raspberry Pi. At the time I thought to myself “That’s cool, but what on earth am I going to use this for?”. Now given my sudden freedom, I figured I can finally put this thing to good use; maybe even learn a new programming language, and this crazy thing called “Object Orientated Programming” that lecturers on my course kept waffling on about – which having only experienced procedural background at that point seemed like a strange and magical thing.

But what contraption could I invent with this tiny credit card sized computer? Perhaps a sentient A.I. that would put Skynet to shame? Or how about a doomsday device so threatening that it would place humanity at my fingertips?

Maybe I was asking too much from this 400MHz processor and my programming abilities at the time. My plans for world domination would have to wait.

I settled instead to bring to life a character from a TV show that I had been binge watching. His name is BMO and he exists in an animated show called Adventure Time.

I figured that the fact he was already an anthropomorphised mish-mash of an old GameBoy and an Apple II computer that he’d translate perfectly into physical form and give me plenty of scope to build parts of his character into an actual product.

A diagram showing that if you add an old Gameboy Console together with an Apple 2 computer you get the end result of the character BMO from the cartoon Adventure Time.
Creation

Given its almost symbiotic relationship with the Raspberry Pi community, I figured Python would be the best choice to realise my vision. So I spent the next couple of weeks learning the language and playing around with a library known as Pygame that would allow me to create the visual aspects of BMO.

It all started out simply enough. I threw together a method of creating BMO’s facial expressions procedurally from a library of facial components that I created. This would allow BMO to sit there and look around while pulling faces, and occasionally shouting out random sound bites from the TV show. “Great”, I thought. Now what? What else could he do?

Here’s where I went wrong. Eager to expand on features that I could add to BMO, ideas began to snowball and I dived straight into writing code without giving a second thought about how it was all going to fit together. Well it did all fit together – in the same sense that if you jam a square peg into a round hole with enough force, it will eventually go through.

A joke image supposedly showing a UML diagram of the implementation of the BMO program, when in actual fact it is a picture of spaghetti.

By the time I added extra features such as a video and music player with NAS streaming, various gaming emulatorsimage viewer etc., tied together with an 8-bit inspired UI, my code; with its many functions that go on far too long, that is prone to throwing exceptions, and with enough cross dependencies that it began to resemble (a bit like this run-on sentence) a plate of spaghetti.

⇐  Fig1: A UML package diagram of my implementation
Lessons Learned

After spending a year at Zircon as a placement student whilst gathering knowledge from my own mistakes and learning from colleagues, that are far wiser than I, I have evolved from a naive programmer into a functioning software engineer.

I now understand that to build functional, reliable and robust systems requires establishing requirements, architecting, designing, creating test cases and reviews – all before writing a single line of code. These collectively are best practises in our Industry!

Had I applied these concepts before I began creating BMO, I would not be concerned about the potential for a nervous breakdown every time I consider making a few changes or maybe even adding some new features. But at least I didn’t attempt to create that doomsday device after all.

A picture of the final build of the BMO Raspberry Pi project.
⇑  “Not Quite Skynet, but Close Enough”

More From The Blog

IR35, Here it Comes Again…

IR35, Here it Comes Again…

IR35, Here it Comes Again...In 2021 the reform to IR35 Off-Payroll rules is to be rolled out to the private sector. As before the reform will only affect companies that do not meet the following attributes: an annual turnover below £10m fewer than 50 employees or a...

Solving the Resource Conundrum

Solving the Resource Conundrum

Solving the Resource ConundrumPicture this. One minute all is fine and dandy, you have access to all the resources you could possibly need, then bam an unexpected challenge arises. Suddenly you find yourself lacking the capacity to meet the new need. What are your...

Quality – An Aid to Produce Consistent Rubbish

Quality – An Aid to Produce Consistent Rubbish

Quality - An Aid to Produce Consistent RubbishAnother year has passed, and myself and a colleague have hosted a BSI auditor for our annual ISO9001/TickITplus check-up, and in fact this was more than the regular check, in that it was our 3-year re-certification audit,...

The Hazards of Legacy Systems

The Hazards of Legacy Systems

The Hazards of Legacy SystemsBeing the owner of a software system with a dedicated customer base sounds like the kind of position one would like to find themselves in. At least until it gets superseded and you have to face dealing with a legacy system. Many developers...

How to Test Without Access to The Test Environment

How to Test Without Access to The Test Environment

How to Test Without Access to The Test EnvironmentIn many of our previous articles, we have expressed the importance of achieving a high standard of testing. Potentially blocking this achievement, several factors can come together to affect the quality of your...

The Technical Workshop – How To Make Them Work For You

The Technical Workshop – How To Make Them Work For You

The Technical Workshop - How To Make Them Work For YouAnyone experienced in product design will understand just how valuable a facilitated workshop can be. Bringing together a project's key stakeholders into a single space allows for the exploration of diverse...

Developing Software for Safety Related Systems

Developing Software for Safety Related Systems

Developing Software for Safety Related SystemsSoftware systems should always be both robust and reliable, however the moment you introduce a safety element, this need for reliability increases significantly. The level of safety required is governed by the severity and...

How to Choose an Outsourcing Partner

How to Choose an Outsourcing Partner

How to Choose an Outsourcing PartnerHaving recognised a need to outsource, and worked your way through the initial preparations, you are now in a strong position to seek out a suitable partner. Choosing an outsourcing partner is no trivial affair, so taking the time...