DEV Community

Stefan Pavlovic
Stefan Pavlovic

Posted on • Updated on

The Advent of Code 2020 - thought process and conclusions

This blog post will give some context for my future blog posts on this subject. I will write about the insights I got from AoC 2020.

Future posts will probably be shorter than this one and will go straight to the point. Also, I will try to focus on one subject per post.

For example, one of my future posts will be about using value objects instead of being obsessed with primitives and concrete examples in C#.

The form of my future posts will be following. What problem I got, how it is affecting my solution and code, how it can be solved (what value we will get), and how this problem will look on a larger scale.

How the advent of code works?

The advent of code 2020 is a coding challenge that is made of 25 days. Each day contains a challenge broke into multiple parts.

The fact that we first get only one part of the challenge without knowing in which way the requirement will change, or what will need to be added in future parts made me commit to this challenge.

I think this is an ideal environment for improving our thinking because this is really close to the real-world environment. Requirements are changing, existing code needs to be extended, new features that are written can change and we need to be prepared for this change.

Most important thing is that here, in AoC, we have a safe environment where we have the freedom to experiment.

In real-world applications, this isn't always the case. Also, in my opinion, it would not be responsible to experiment with production code.

What I am expecting to get from this challenge?

By the end of this challenge, and with each day solved, I am expecting to write better code.

Now what is better code?

In this case, better code will not be the most performant code that can be written, not this time.

Better code is readable, reusable, simple, and performant enough to satisfy business requirements. In other words, the best code we can write is code made of smart tradeoffs.

Getting maximum value from this challenge

Obviously, there is a broad scope of values that we can get, or not get, from working on AoC but my reasoning is the following.

These challenges can be solved fast. We can be fast when there is empty paper put in front of us.

The question is how to be constantly fast? How to be able to change fast? How to be able to change at all? How to change and be sure that everything is working as it should? How other developers that are looking at the work we already did can know what were our intentions? Can we make such a design and solution that will guide the developer which is changing it only in one, right, direction?

Questions are the answer in this case. I will try to achieve this.

I am not expecting to answer all of these questions, but we need to strive for perfection if we are thinking about ourselves as professionals.

Current status

I just "finished" with day 4 of AoC 2020. When I say finished, that means correct solutions are found, but does this means I am done with this code? Certainly not.

The code I wrote is still not "production-ready". I didn't yet prove an absence of bugs (unit tests), refactoring is needed on both "day level" and general AoC solution level, the solution can be improved in general, etc.

What to expect?

Atm, I am thinking about two subjects. Why immutability is a good thing and why not be obsessed with primitives (and use value objects).

If you are interested to hear more stay tunned :)

Top comments (0)