← Back

Advent of Code 2023

I have participated in Advent of Code for the first time this year. Here, I reflect on my experience and lessons learned.

Published: Updated:
Advent of Code 2023
Advent of Code 2023 (Photo by Vidar Nordli-Mathisen on Unsplash)

December 1-25 every year is a special season. First of all, many people around the world are looking forward to celebrate Christmas. However, this period is also special for many software developers. The reason is the Advent of Code (AoC) — a set of programming puzzles wrapped in a Christmas story. Every day until Christmas, a new programming puzzle is made available that requires you to write a program to calculate a scalar value, typically an integer, based on a textual input. Every problem consists of two parts, where the second one is usually harder than the first one (but builds upon similar solution).

How I got there

I heard about AoC before, but never had a time (read patience and/or courage 😁) to participate. I thought this year would be no different, but one of my colleagues set up a private leaderboard and managed to get quite a few people in. I signed up as well, because why not? This is how my first AoC came to be.

Many people who participate in AoC take this as a chance to improve their skills in some programming language. I decided to do the same and set out to complete all puzzles in Rust 🦀. If you are interetsed, you may find the solutions in this GitHub repo.

My impressions

In the hindsight, I can say that it was a very nice experience. I have learned a few things in computational geometry and theoretical computer science, as well as became much more comfortable with writing Rust code. I would definitely recommend anyone who never participated to give it a try.

Now, on to the things that I didn’t like. AoC is set up as a competition. There is a global worldwide leaderboard, and you can also create a private one to compete with your friends or colleagues. The main criterion is speed, i.e. who is the fastest to get the answer. I understand that this is the easiest metric to judge upon, but it also makes people who are very much into the competition to cut corners and develop bad habits. Every problem follows the same general idea — based on a text input (lines of strings or a 2D map of characters) calculate a single number to submit into the input field at the end of the problem page.

I have noticed that some people, trying to beat their peers cheat and use Large Language Models (LLMs), like ChatGPT, to get the answer, or simply take someone’s code and run it to get the answer. Since all that matters is the final answer, the code itself and its quality are not a concern.

I also felt the stress of competition and the urge to solve the problems as fast as possible, instead of considering several solutions, analyzing trade-offs, and enjoying the puzzles. To anyone reading this, my piece of advice will be to try AoC out, but do it for yourself. Avoid competition and use this as an opportunity to learn something new (quite a bit of puzzles use math concepts and theorems) and get better at the chosen programming language. Even though the competition is on December 1-25, you can take as much time as you need, the puzzles will always be available for you to solve later.

Summary

In summary, I think AoC 2023 was worth it. I think I will participate in AoC in the future as well, but I will avoid competition to have a chance to enjoy solving the puzzles without any pressure. I may write a few more posts based on AoC 2023, highlighting some of the new knowledge I acquired while solving the puzzles.