So helpful to work with

41 points bunoso

I’m doing the Advent of Code in rust and there are a few things that have made my experience awesome, very informative, and enjoyable.

  1. Hashmaps have the ‘entry().or_insert() += number ‘ functions that take away a lot of boilerplate that is in Python.
  2. Having unit tests build into the cargo makes it easy to run. Once my unit tests work, my code gets the right answer most of the time
  3. I have better respect for simple data structures, meaningful structure, and smaller functions. Going back and redoing the code for part 2 of AoC makes me better think through part1. I realize I can use a vector for most things in rust.
  4. Iterators are the best. Filters, maps, any, sum, add, are wonderful and easy to read.

That’s it for now. Best of luck.