Advent of Code 2023 programming language options

Every year, I participate in (and financially support, though not enough for sponsorship) Advent of Code, a series of daily coding challenges from 1st December to 25th December. I’m intending to do so again in 2023, though the question I haven’t answered yet is: what programming language should I use? I could of course solve each challenge in multiple languages, but realistically I’ll only have time to use one each day.

PHP: The most obvious choice – I write this every week day at work and also in my personal projects. I know it extremely well and it is easy to implement data structures (e.g. hash maps are just arrays with non-numeric indexes). I probably won’t learn much, but would be able to solve the challenges quicker than in any other language.

C: I’ve used C for solving challenges in the past, and it forces me to think a bit more about things like how much memory my solution uses. I would also like to practise C as there is a lot of existing code out there and one of my specialisms is maintaining legacy software.

Go: Last year I used Go and mostly enjoyed it, though a few things bugged me (e.g. the lack of a string reversal function, which would be very useful for some exercises). A bit like C but without having to worry about memory management, and dumping data structures to the console is easier. Go is used in web development and DevOps so is useful commercially.

Lua: I’ve never written Lua but I am interested in its use in embedded areas, such as scripting languages for game engines – especially Baldur’s Gate I and II, which I’ve spent far too much time playing over the years (I would like to contribute to some mods that I’ve used).

Assembly: I enjoyed writing this when I worked at a university, as it forces you to think about exactly what your code is doing and what resources you use. However, it does take a lot longer to implement solutions due to having to write each instruction separately, instead of having a compiler generate them. Given the hardware I have to hand, I would have to choose between Intel and ARM instruction sets (I could use qemu to emulate other architectures, but this adds even more time and complexity).

Rust: A lot of my friends use Rust for AoC and it’s probably the most talked-about language on my Mastodon feed. I like the idea of memory safety but I think getting my head around new concepts like borrowing would slow things down.

Functional language: I’ve never managed to get to grips with functional languages (e.g. Haskell) – my mind seems to think in imperative only. As with Rust, I think a new language and new concepts might be a bit too much as my first choice.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.