Advent of Code - 2023 Week 1

Advent of Code - 2023 Week 1
Photo by Compare Fibre / Unsplash

Advent of Code - 2023 Week 1

It’s that time of year when Advent of Code comes out. I haven’t participated in past years, but given my life as a Developer Advocate currently, has taken me out of daily coding, I decided to participate.

Spending the last two years as a Developer Advocate has left me thinking in terms of simplicity when it comes to code. I can tell that the skill of creating elegant solutions or concise code has atrophied.

Start With What Works

I’m 3 days in and it’s become apparent that my current workflow is, to get something that works and isn’t elegant. I then begin refactoring the code to clean things up. That isn’t a bad approach at all for tackling a coding challenge. I’m surprised that I think in simplified terms as much though.

That being said, the best way to learn and improve is to start. It’s common to be stuck in the tutorial loop where you feel the need to keep following tutorials to learn and a great thing about events like Advent of Code is they encourage and force you to build.

Building With A Partner

For these first few challenges, I’ve loved partnering with GitHub Copilot. While it’s tempting at times to test the abilities of the AI and see if it could solve the problem on its own, the more interesting thing to do with it, I think, is to use it as a coding partner. It’s a fantastic resource to ask questions of.

I’m looking forward to the day when I have a personal Jarvis. I’m finding myself being on the side of the techno-optimists. The future is bright with AI to help us, the same way these notes are much easier to share than in the time before blogs and newsletters.

How did I use Copilot? One example that stands out is understanding how to simplify map and reduce when combined. I used map then reduce to filter and then summed the results. While talking through my code, Copilot pointed out that I could simplify my code by doing everything within a reduce.

The experience of discussing my code with Copilot lives somewhere between rubber duck debugging and pair programming. I don’t think it’s to the point of replacing the power of two people working together but it is a force multiplier for developers. I’m looking forward to working with this new technology. If you haven’t tried it you should give it a try.