So helpful to work with
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.
- Hashmaps have the ‘entry().or_insert() += number ‘ functions that take away a lot of boilerplate that is in Python.
- 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
- 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.
- Iterators are the best. Filters, maps, any, sum, add, are wonderful and easy to read.
That’s it for now. Best of luck.