I discovered Advent Of Code in 2018, but have suspended the efforts after 15 days or so. This year I vowed to do better and sure enough I completed the last puzzle, 25th, right on time, on Day25: Xmas morning. A part of the motivation came from the competition (Storytel had a private leaderboard where the battle was fierce every morning to the very last day), part of it from the puzzles themselves, but most of it probably came from the fact that I had retired into management (to steal a phrase from a friend) and am now contributing to Storytel not with Code but as a Tech Manager.

Advent of Code 2019 Day 17: Part 2 was my favorite problem/solution of the year

And indeed this is the first learning: Even while I myself do not wrestle with code in my professional day-to-day, feeling mastery of the medium is still very important to me. I take pride in my past developer achievements and my self-image depends on being able to do things myself and do them well. Completing the 25 day challenge proves to me that I indeed have relevant knowledge to what I am asking my team members to do at work, not only on high level where I am actively contributing, but also all the way down to the code. Does that makes me a better manager? I will let you to ponder. I hope so, but am trusting it at least doesn’t hurt.

I had also used the puzzles to get up to speed with new features of C# 8 that have been released since I moved on from my developer post. I think that is the beauty of the approach-agnostic nature of Advent Of Code: One can “use it” in any way — indeed for any purpose — one wants. A lot of people use the puzzles as a set of waypoints to learn a new programming language, but one can just as well use it to reinforce fading knowledge before it disappears completely, or to focus on Algorithm Development — something that many of us enjoyed at the university but few professional developers get to do at their day job.

That leads me nicely to my penultimate point: I had forgotten a lot of my university level math — but surprisingly the learning is that I am OK with that.

The contraversial Advent Of Code Day 22 part 2. Numbers like these prevent a solution involving simulation, math is required.

This year’s puzzle crop featured one challenge that raised a lot of feedback from the community, including on reddit. The puzzle involved shuffling items and while part 1 was easy enough, involving parsing instructions and manipulating items in containers, part 2 was on another level altogether. Even from the first glance it is obvious that the scope is much too large to be able to rely on an approach that simulates each step of the shuffle — the time required would not be on a human scale.

I had taken some advanced math courses during my university years including Discrete Mathematics, Set Mathematics and Modular Arithmetic that is required here. And while I remembered enough that I understood what principles are interplaying here, I have no problems in admitting that deducing the complete formula was beyond the scope of my ambitions for Advent Of Code. Instead I had decided to stand on the shoulder of giants and implemented the mathematics provided and explained by a kind redditor (thanks /u/etotheipi1). Even doing that made me remember a lot about BigIntegers and how one implements modular arithmetics in C#. That was more to my liking and after struggling for a while with the math, but not making headway, I was happy to admit that.

My final learning from this year is a reflection about how writing Enterprise Software changes you as a developer. I understand and agree that a part of the fun with Advent Of Code is to write “throwaway code”, focus on getting to the solution and not the maintainability, to take shortcuts, and to, you know, hack. Well I didn’t. I abstracted code into utilities (maintained in aptly named SantasToolbox dll) and then wrote tests for those utilities. I was not satisfied until I had a fully working implementation for both part 1 and part 2, making me write abstractions that wouldn’t be necessary if I just wanted to “get to the answer” and discard part 1 on the way.

Advent of Code 2019 Day 13 invited us to programatically solve the classic Breakout game

So yes, having years of writing abstract factory providers and the like under my belt has left an impact on me. My code is fundamentally different than without having the experience of working in a long-running project with hundreds of contributing developers working on the same codebase, pushing in the same git repo. And you know what? I like it better that way. Yes, I haven’t made it to the top 100 leaderboard a single time in the 25 days nor did I succeed winning our private Storytel leaderboard (I came in third). At least some of it is down to this way of writing software. But that’s ok as I was writing software the way I like to, the way I feel it should be written.

With this retrospective I am concluding my Advent Of Code 2019 adventure. Ultimately I had a lot of fun while learning a whole bunch. I believe I will be back for more come December 2020.

Want to work for a manager that “gets it”? Storytel is growing aggressively and we are hiring. Check out our open positions or give me a shout on LinkedIn. I would love to talk to you.