In this series of blog posts, we’re going to look at coding challenges and how we can best utilise them to learn new things and have a good time.
What is a code challenge?
Actually there are a bunch of different things that you could comfortably call a code challenge, and despite them being quite different you wouldn’t be wrong for using either.
A “coding challenge” is a programming assignment that tests the abilities of software engineers.
A code challenge is a competition for creative ways to solve a programming puzzle.
Now if we’re being honest, one of those sounds a lot more fun than the other, so that’s the one we’re going to be spending most of our time on. My ultimate philosophy is that life is about having a good time so I try to align my efforts to optimise for that outcome. I’m having a good time right now writing this blog post, and I’m going to have a good time later implementing some of these code challenges. If I learn something along the way, then that’s a nice little bonus.
Why would we do code challenges?
Ah, the crux of any matter. “What is the point?”. Well, as stated earlier- ultimately the point is to have a good time. But other than that, you can use code challenges and exercises as ways to practice skills and bring people together.
Advent of Code is a fairly popular set of code challenges, and one of my favourite parts of that was taking part in the competition at work to see who could score the most points (I have serious issues with gamification addiction). For a while anyway, it was less fun having to wake up at 4am to solve the problem first to get the most points, but that just circles back round to “have a good time”.
I use code kata from Agile Katas as a tool to teach Test Driven Development to the graduates and interns that join each year at work. I might talk about these more another time, but code kata are generally good little code challenges for demonstrating a point or practicing a skill.
The kind of code challenges I want to focus on here are fun, visually appealing (kind of) challenges for a small group of developers- maybe a scrum team, perhaps a university group, possibly a hackathon squad. I ran this kind of thing several years ago for my scrum team at work, and it was kind of ok.
Emphasis on the “kind of” here, although I’m sure something has gone wrong because this looks worse than I remember. This one was a Tron-inspired game called “Lightriders” where you would have to implement an algorithm for staying alive as long as possible, whilst in an arena with your opponent. The twist here is that everywhere you move leaves a “lightwall” behind which you aren’t allowed to hit, otherwise you lose.
My team each implemented an algorithm for their bike, along with an avatar and a colour (Here you can see a blue Sonic, and a yellow Cat), and then we had a tournament to see who would win. I don’t remember who won anymore, aside from it probably wasn’t me otherwise I would remember.
Anyway that’s not important, what’s important is that we had a good time and arguably learnt a little bit of something about something. I might remake Tron now that I am infinitely more talented than I was at the time.
But not yet! First, I am going to do something easier, something cooler, something with more dinosaurs.