🎄 Intro

After a very interesting and fun SUSE hackweek, as every December since some years, I took part to Advent of Code.

First of all, I wish to thank Eric Wastl because he’s giving us every year a great and unforgettable advent-ure.

aoc_picture [image source: Reddit u/edo360 ]

✨ What’s Advent of Code ?

More than just a countdown to Christmas, AoC is a joyful game that invites developers of all age and levels to sharpen their problem-solving abilities and coding skills. Like a virtual advent calendar, AoC presents a new programming puzzle each day from December 1st to 25th. These puzzles are often deceptively simple at first glance, but they quickly unfold into intricate challenges requiring clever algorithms and efficient code.

Over the years the number of people playing is steadily increasing, with almost 300.000 users completing at least one puzzle. This year was so special because it’s the 10th anniversary, so at the end I managed to complete ALL the puzzles and reach 500 Stars!

500_stars

🎁 Some personal highlights

As a deliberate choice, I solved most of the days using a mix of two languages: the D Programming Language and the Crystal Programming Language. I’ve been wanting to explore both further, and AoC seemed like the perfect playground.

Crystal, with its Ruby-like syntax, lets me write expressive code quickly, which is ideal for those early morning puzzle-solving sessions. And when performance becomes critical, Crystal’s compiled nature really shines.

D, on the other hand, offers powerful metaprogramming tools that allow me to experiment with different approaches and build reusable solutions. Plus, its modern features and blend of high-level and low-level capabilities make it a joy to use.

Despite being lesser-known, I think these are great languages to use and they should be more widely known in the IT environment, so I took the occasion to advocate and spread some knowledge about them. If you are curious, you can find most of the solutions on my github repository, just be aware that this is not intended to be production-ready code, it’s written just for fun at 6AM every morning and it’s not following any best practice: on the opposite side it’s my vacation and experiment time to play some dirty trick and write concise, almost unreadable code on purpose… You are warned 😅

If you understand Italian and want to hear me talking about Advent of Code I also had the pleasure to be a guest in a podcast episode from the guys at Pointer Podcast 🎙️. Highly recommended to subscribe!

Among all the 25 puzzles solved during the month, I can cite:

  • Day 1 as the starting gives an easy start to be tackled with many different approaches
  • Day 3 because it allows to familiarize yourself with regular expressions and some edge cases
  • Day 6 as the first “grid” problem, easy but part2 not trivial; also resembles a mechanism already seen in some videogames
  • Day 7 an easy one to upskill on recursion and backtracking
  • Day 8 and Day 13 for playing with vector math
  • Day 9 for the idea to implement a very basic disk defragmenter
  • Day 12 gardening: weird shaped area and perimeter measurements
  • Day 14 moving robots: an unexpected plot twists on the second part!
  • Day 15 instruct a robot to play a sokoban variant
  • Day 16 and Day 20 maze puzzles with a “Race Condition” twist, where players can “glitch” through some walls
  • Day 21 where even the problem statement is recursive: you need to control a robot that controls another robot that controls a robot to press some buttons …
  • Day 23 and Day 24 two classic theory problems about graphs and boolean logic
  • Day 25 a final easy one that can be solved in many ways, with special attention to performance optimization

According to Leaderboard times, the most difficult days were 15, 17, 21 and 24. I totally agree, go check them if you like hard challenges 😁

🎅 You are not alone

A special mention to the community: the best thing of Advent of Code is being part of a collective experience, where for each day you can share opinions, get or give advice, read funny memes and play together with a lot of smart people. It can be Reddit or your local friends, a Telegram Group or a Slack Channel, but sharing it with other people is the real reason why it’s enjoyable.

  • Collaboration sparks creativity: Tackling AoC with friends or colleagues opens up a world of shared insights and diverse problem-solving approaches, leading to “aha!” moments you might miss on your own.
  • Motivation and accountability: Knowing others are working on the same puzzles keeps you motivated and engaged, even when the challenges get tough.
  • Learning and skill-sharing: Explaining your solutions and discussing different coding techniques with others solidifies your understanding and exposes you to new ideas.
  • Friendly competition and camaraderie: A little friendly competition can be a great motivator, and celebrating successes together makes the experience even more rewarding.
  • Turn coding into a social event: AoC can become a fun social activity, whether it’s through online groups or in-person coding sessions with friends.

☃️ Final thoughts

Whether you’re a seasoned developer or just starting your coding journey, Advent of Code offers a unique and rewarding experience. Beyond the satisfaction of solving intricate puzzles, it’s an opportunity to explore new programming languages, optimize your code for efficiency, and learn from a vibrant community of fellow developers. So, embrace the holiday spirit, grab your favorite programming language, and dive into the captivating world of Advent of Code. Who knows, you might just discover a new trick or two along the way!

As this year’s advent finished, the puzzles are still online: you can try and solve them at anytime.

ps: If you are interested in Rust and crazy performance optimization, I can recommend to checkout Advent of CodSpeed 🐇