It's been a while since I tried doing Advent of
Code, so I thought it might be fun to give
it a shot and post my solutions here. I'll try to use a different
language every day, and I'll explain any notable or obscure features I
use. My solutions are available in a git
repo if you want to
take a look at them. You can run any of the samples with make
like,
for example, make 2024-03-2
to run day 3, part 2's solution. You'll
need to add input files named eg 2024/input/day-03.txt
that you can
get from the Advent of Code site to run
the solutions for those days.
Doing things in different languages can be very eye-opening. Sometimes it's not--you probably won't learn much doing something in Python and then Java, because they're both procedural OO languages with very similar object models for most uses. Other times, though, it can be really enlightening, particularly if the language you're using encourages a different paradigm. Prolog, for instance, feels very different to right in compared to C, and by default uses a very different approach to writing programs. You can do logic programming in C, too, but Prolog encourages it, and makes it hard to avoid.