Andre Wruszczak

01 Dec 2023

Advent of code!

participate and suffer along!

Chocolate and Code

One thing that I actually like about Germany is the widespread love for advent calendars. It may be a childish thing, but I personally cherish this tradition a lot.

It’s so lovely to have this unusual calendar1 around, filled with a daily reward of some sort - usually chocolate!

Advent of Code does pretty much the same thing, only instead of chocolate it’s filled with delicious programming challenges!

How it works

Every day between December 1st and the 25th around midnight EST/UTC-5 a new challenge get’s posted on the current calendar.

You just need an account to participate.

The challenges contain a lot of flavourful text as well as the actual problem to solve: the players are normally tasked to help save Christmas one way or another. Usually this involves a lot of interaction with Santa’s elves who are notoriously horrible at their jobs2.

The faster you solve it after the global start of the challenge, the more points you get. There is a global leaderboard but only the first 100 players to solve the challenge actually get points there, therefore people on that list are ridiculously good at coding challenges.

For people who cannot inverse a binary tree in under a minute (blindfolded mind you) - advent of code offers the possibility to create private leaderboards, allowing you to compete with your similarly incapable friends or colleagues3!

Opportunity for learning

The beauty of advent of code is, that it’s completely programming language agnostic. You can choose whatever you want - the input is just a text file containing your individualized challenge input and to solve it you simply paste your solution to the designated form field.

Some people even solve the challenges using Excel or similarily silly tools4:.

I think it’s the perfect opportunity to try out a new language or even paradigm! Maybe you would like to try out this Rust everyone is talking about?

Personally I’m challenging myself this year by using Elixir! I thought about using Julia, Zig or Golang - but I feel like it would be too soon for me to dive into yet another language.

Difficulty

Be aware though, the calendar might start with trivial challenges at first, but usually around the 18-19 day mark it gets really tough and time consuming.

Unless you are some sort of code challenge prodigy, you should plan >2 hours for those at least. Sometimes the biggest challenge is actually finding time around christmas :D

It’s important to not get demotivated by those tough challenges though. They normally involve some sort of algorithm you simply might not have encountered yet! Once you know these, it get’s a lot easier.

If you want to prepare, I highly recommend checking out at least:

  • shortest path algorithm
  • flood fill algorithm
  • memoization stuff

You don’t need to though, in my opinion most of the fun is coming up with your own solution!

Fun!

I love puzzles!

I might love puzzles too much actually, if I can’t solve a puzzle it haunts me. It will occupy a big part of my brain for quite some time5 very much to the dismay of my loved ones.

Once I come up with a solution and I get that coveted star from advent of code, all the suffering was well worth it!

Honestly, I think advent of code helped me rediscover my love for programming!

So if you currently want:

  • to try out a new programming language,
  • to brag to your coworkers
  • a small challenge to respark your love for programming
  • to challenge your friends

you should give it a shot!

Footnotes

  1. normally my calendar is filled exclusively with dreadful deadlines and the like :(

  2. to be fair, I don’t think they get paid - so I totally get it.

  3. be aware, it’s a competition after all. So don’t be surprised if people start trash talking and so on :D

  4. yes I think Excel is silly. Sue me Microsoft.

  5. usually until I actually solved it.