/aoc22

My solution to the Advent of Code 2022

Primary LanguageRust

Advent of Code 2022

Spoiler alert

This repository contains my solutions to the Advent of Code 2022.

Some random thoughts

During the last month, I've been using Rust exclusively, so I thought this year's Advent of Code would be a good opportunity to write some code using Kotlin again. At first, I was kind-of happy, as the Kotlin code usually worked and appeared like less code, so less work to me. Then, I quickly learned that less code does not mean less work. Kotlin has terrible error messages that don't always point you in the right direction or otherwise lack crucial information, like saying that a method cannot be called on this type, without saying what this type is, and then listing a bunch of irrelevant function signatures. Or instead of saying that it cannot infer type information, just inferring the Nothing type and then giving a bunch of other unhelpful errors. Or highlighting the entire file in red because at the top, I used -> instead of : to separate the function arguments from the return type. Pretty stupid.

So long story short, I'm continuing the days with Rust, as solving the Advent of Code is fun even if I'm not doing it for refreshing my knowledge of Kotlin. While the Rust code is objectively longer, it is easier to write than Kotlin, has fewer bugs, and those bugs are easier to debug and fix. In 2022, there is just no excuse to write bad, unhelpful compilers. Rust has proven this to be quite possible, and while I don't think that Rust is the single best programming language that will ever exist, it looks like from the currently existing programming languages I've tried so far, it absolutely is.