This year is the first time I've participated in Advent of Code, and it's caused me some problems and highlighted some issues I need to address.

Content warning for discussions of my mental health.

My Problem

I was planning to explore some of this in my EndOfYearPost™️, but now's as good a time as any.

This year has been a fun delve into my mental health. Not with a professional, but with myself, so take everything with a handful of salt.

A core part of my mentality is based on my performance. I must at all times be performing my best while performing increasingly impressive "feats" (take that to mean what you will). While this problem isn't isolated to just programming, that's part of a wider discussion.

If I'm not performing my best, then I feel terrible. That can mean many things. Maybe I'm stuck on a problem that "should" be solvable. Maybe I can't do the "right" thing because of time constraints. Sometimes, it's not even my "fault". The library I'm trying to use doesn't work as well as expected or similar, and it leads to endless unsolvable problems, (this has been particularly relevant to me professionally in recent times as I've been working with mobile device cameras). Any one of these things can ruin an otherwise great day/week.

To satisfy this need to perform at the highest levels, I keep starting more and more complex projects. Aiming higher and higher. I've tried many things, from building a stock-trading bot to making a search engine and an MMO. Only for every one of the projects to be abandoned. And with each abandonment comes failure, with each being more painful than the last. Ask my friends; we did a tally a while back and came to something like 80 unfinished/abandoned projects 🫠. And, of course, the only logical way to redeem myself for a failed project is to start and complete an even more complex one.

After the discussion where my friends and I tallied up my unfinished projects, I swore a vow not to start a new project until I completed one. I did not want the number of projects to increase any further and add to my perceived failures. I was doing well, even completing some of them, including shipping my hackathon project, finishing the redesign of this website, and painting some Warhammer models.

Programming Challenges

For many years, I have found a great source of pride (and big-headedness) in being able to solve "hard" programming challenges. Initially, many of these came from the projects I was working on, such as various graphics-related problems from making games or inverse kinematics from my foray into building a robotics simulator.

As the years went on, I ran out of fun project ideas and turned to other programming challenges such as LeetCode, CodeCademy and Project Euler.

I never found the first two particularly inspiring, mostly just things I'd had to solve myself previously, and if it's not new, I'm not interested. Project Euler, though, captured me.

While I'm not good enough at maths to understand some of the problems, it didn't stop me from trying. I've spent what I can only refer to as a silly number of hours trying some of these. Thankfully, because these are "maths hard" rather than "computer science" hard, I didn't take my inability to solve some of them too much to heart.

As another by-product of them being mostly "maths based", I wasn't able to get many of my friends to participate, so there was no-one I could really compete with.

This should have been a warning of what would come if I tried Advent of Code.

Advent of Code

The competitiveness

On rolls the first of December, and I'm feeling good. After having a go at it, I mentioned it to some of my friends, who also decided to give it a go. Great, now I am not only competing against the internet, I'm competing against people I know, and I have to prove that I'm better than them.

Here in lies the first problem. My primary motivation for Advent of Code was not "Can I complete these?", but "Can I complete them faster and better?" than others. Maybe I knew this from the start, but I might've (and likely did) repress that as I knew it was bad.

This got out of hand. Not only was I waking up early to be first, but I was spending every break I got working on the problems. Getting the answer was no longer enough. With other people posting their code and benchmarks, I had something even better to strive for. Solving it was no longer enough. I had to have the most optimal solution. My code had to be faster and better written.

Oftentimes, these optimisations took much longer than just solving the problem. Those are hours I'll never get back, chasing performance metrics that ultimately don't matter and no one was actually competing with.

The Blogging

At the start of the first day, I hadn't even thought about posting anything to do with Advent of Code, but then, Robb showed me Lewis' post, and it got me considering it.

I love talking about and teaching programming, so this seemed an obvious choice. So, after some faffing with getting the style right, I posted my first post.

With that simple post, I signed myself into an unwritten contract that would not only solve all the problems but also write about them. So when day 10 came, and I didn't finish the problems, it was not only a personal failure, but it also felt like a very public failure. I know it's not, and I wasn't the only person who didn't finish that day, but because I'd made an effort to write about all the other days, it felt worse than if I hadn't.

Another unfavourable aspect of blogging was it was a very public statement of "here's what I can do, beat it if you dare", which is less than healthy.

The Camels Back

I'm not exactly sure where it fell apart and became an obvious problem. Day ten was an obvious marker, and missing day 12 was probably the final straw, but I think the problem appeared earlier when I almost made myself late for things because I was busy either solving the problem or writing about my solution.

The first few days were great, but as time went on, the problems required more and more time, which I ultimately didn't have, and I was starting to sacrifice important things. Also, the pace required to keep up is relentless.

As the days progressed, fewer people were posting, and my friends' enthusiasm also seemed to die. And I sadly think that's what ultimately did it. I'd already "lost" to the internet as there we still lots of people completing the challenges I could not. And I'd already "won" within the circle of people I know.

What Now?

Today was the day of reckoning. I don't know if it's because I got an unusually good night's sleep, or what, but I saw clearly what was happening. Advent of Code, and the self-imposed competitiveness around it, was fuelling one of my toxic traits and causing me problems, and it had to stop.

I'm pleased I've got this far, I didn't know how far I'd get, and I didn't reasonably expect to be able to do all of the challenges. But I've survived the first few big challenges that saw lots of people leaving and I should be proud of that.

I might revisit these in the future. If I do, I think I'll do so privately without posting about it. But for now, I'm done. I should spend my time on less toxic things and enjoy the holidays.

PS

This is not a reflection of Advent of Code or anyone else who enjoys it. If you can enjoy it in a healthy way, then you should continue too 🙂.