Finished reading: The Self-Taught Computer Scientist by Cory Althoff 📚

This is the book I wish I’d read before doing Advent of Code - a full blog post on that will eventually be on my main blog; I finished both parts of all 25 exercises in (strictly) base R, and am more than halfway through re-doing all of them in Rust. I was surprised at how much computer science was needed to solve these, but I did enjoy what I learned along the way, so actually reading up on some of it seemed like a good idea.

This book is the follow-on from ‘The Self Taught Programmer’ (now on my to-read list) and does a really good job of walking through the concepts, partly framed at setting the reader up for being able to solve the typical software engineering interview questions. The code is python, which is approachable enough. There’s some minor funkiness of seeing

if condition:
  return True
  return False

rather than just returning condition but otherwise the code is carefully explained. I believe this has the best explanations I’ve seen of ‘big O notation’ for time complexity and how the different variations arise. Similarly, this is the first time I’ve understood what a linked list and binary tree are (and how/why someone may want to invert them - I’ve only seen the stereotypical interview question).

As always, the more you learn about programming in one language the more you learn about all the other languages you know, so now I’m interested in understanding some of these concepts from an R perspective. I certainly made use of VecDeque and HashMap in my Rust AoC solutions, but in R I was stuck with poorly-performing vector and list objects, which I occasionally improved with an environment. I was very happy to see that R 4.2.2 gains utils::hashtab() (link)!.

Overall I was happy with this book. A great introduction to the concepts, and some useful approaches to interview questions (if you’re likely to be asked them).