’Twas The Code Before Christmas

Adam Juraszek

6 minutes read

Fri Nov 26, 2021

’Twas The Code Before Christmas

Every December, millions of children jump out of their beds in the morning with one thing on their minds: opening today’s little cardboard door in their advent calendars to discover a hidden treat. Grown-ups sometimes have their own advent calendars, filled with all kinds of different treats. A lot of times it’s just candy, to send them back in time for just a moment, although there are those who like something a bit stronger…and then there’s the weirder ones, who populate their little Christmas palaces with programming puzzles.

Every December, thousands of people around the world make a commitment. Each day during the Advent season, they sit down at their keyboards and solve a programming brain-teaser. For some, it’s a chance to unwind in an otherwise gloomy time of year, for others it’s an opportunity to get better at what they love. It’s called the Advent of Code.

Every night at midnight leading up to Christmas, two puzzles are revealed. Solve the first one, and you get the second one. Every year, there’s a story tying the puzzles together, usually about Santa needing your help to save Christmas. You help him by collecting 50 stars — one for each puzzle you solve.

The puzzles ask you to write a short program to calculate the solution, which is generally a simple number you need to submit on their website. Advent of Code tries to be very accessible — there are no suggested programming languages, and all concepts are explained with practical examples. You might even solve the first few easy puzzles with the first thing you have on hand, like Excel. That strategy quickly falls short, since the puzzles get harder and harder the closer you get to Christmas.

The competition

Advent of Code is best enjoyed with others. The community huddles up in December to figure out the best approach to the puzzles; they go through their thought processes in great detail to help others who might be struggling. And just like in any other gaming event, people stream their progress on YouTube or Twitch.

The big motive behind Advent of Code is that people get to buff up their coding skills, as the puzzles are totally different from problems that a regular frontend or backend developer sees every day. They get a fresh look at programming: gone are the under-specified issues, irreproducible bugs, deadlines, and problems with libraries and frameworks that make you scour Stack Overflow for a solution.

Most people decide to use a single language for all the puzzles. A lot of them pick a language they’re already proficient in, since the final answer is all that matters. Or, they pick a language they want to get better in, sometimes even a brand-new language that they’ve only read about. Some just want to try out what their colleagues work with: a DevOps programmer can try to learn Java, a backend tech can try JavaScript, a frontend expert can slam on keyboards over PowerShell, etc.

Those that know several programming languages have it easier. Some puzzles ask for arithmetic with big numbers, or naturally forming a solution with vector operations or constraint solving. If someone happens to know a language to express these concepts, their program ends up much simpler than the rest.

Then, there are people who set their personal challenges. These go in one of two ways:

  • “If all you have is a hammer, everything looks like a nail” — these are the people who use one tool for all puzzles, even though most people would never even consider it. For example, there are people using Excel, MATLAB, or even SQL. Sometimes they want to showcase their language of choice as more powerful than people think, or that it’s on par with mainstream languages. They can demonstrate its unique properties, some of them coming in very handy in certain puzzles.
  • “You live a new life for every new language you speak.” (Czech proverb) — these people use a different language every day. They combine the challenge of solving the puzzles with learning new programming languages. I will be talking more about this later, as I fit in this category.

People can also create or join a private leaderboard to compete with friends and peers, and there are leaderboards among colleagues and in communities. It brings people together — they see that a particular puzzle is hard for everybody, or that somebody woke up early and solved the daily puzzle before coming to work. There’s also a global leaderboard, but climbing the ranks there is a completely different story.

My Advent of Code

My first Advent of Code must have been in 2017. I don’t remember taking part, but the website tells me I solved 10 days’ worth of puzzles and got 20 stars. Even though I didn’t finish, it made an impression on me.

At the end of the following year, the event popped back on my radar. Since I’d heard a lot about the programming language Kotlin at conferences but hadn’t had an opportunity to try it out yet, I dedicated December to learning Kotlin. 2018 was the first year I finished with all 50 stars.

From then on, I’ve been spreading the idea of Advent of Code at work among colleagues and friends. Some of them had actually heard about it before, and a few of them took part. Going over the puzzles with coworkers at lunch is great, and it started to become a thing in the office during December.

This all came to a head in 2019. That year, I decided to transform my lifelong search for a programming language I’d be happy with into a personal challenge, and I joined the ranks of those who learn and use a different programming language each day during Advent of Code. I hoped to experience the different approaches and unique features of the many languages I’d been hearing about, and maybe, learn something about myself, and what I still need to master.

And then I did it again in 2020. I’ve already used over 50 languages and slept less in December than any other month, but I’ve also woken up happy and excited to see a new puzzle.

This year I’m still sticking with the same challenge, working hard to find yet another 25 languages. I know I’ll find them. I’m also collecting suggestions for languages to use from my colleagues. They’re often esoteric, or even joke languages like Ook, or Ostrajava, although I did end up using some of them, like Fortran, or XSLT. This year, my plan is to focus on languages that compile into bytecode.

If you’re like me, and you like coding, learning, and trying new things, you may want to set a reminder for December 1 and see if Advent of Code is for you.

If you’re like me, and you like a challenge, you may also consider looking at Ataccama — the company I work at. It’s full of brilliant thinkers, coders, and engineers, and they’re hiring all the time.

But I might be getting ahead of myself — have you ever tried any of the Advents of Code? Let me know in the comments and, who knows, we might even get to debate the best programming language in the office one day…

Need a new challenge after finishing Advent of Code? Join Adam and our team! See what positions we have open around the globe.

And while you’re here, take a look around and get to know some of our amazing colleagues like Tomas and Danica. We hope to meet you soon!