diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 20:26:36 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 20:26:36 +0200 |
commit | 9892e3ebde304726903a1e5c358d05c2e343ea5e (patch) | |
tree | 404004f8d2131fa8d1e7524c6707a3ecdb0b44e0 /2019/readme.org | |
parent | 48a9be141afadaa24182781a2db58594cb2ce522 (diff) |
Refile for merging repos
Diffstat (limited to '2019/readme.org')
-rw-r--r-- | 2019/readme.org | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/2019/readme.org b/2019/readme.org new file mode 100644 index 0000000..c674de4 --- /dev/null +++ b/2019/readme.org @@ -0,0 +1,26 @@ +* Advent of Code 2019 + +** Personal challenge + +Try to keep the solution pure. Only main can do IO things, like return +different results when it's called differently. The rest of the +program should only be pure expressions. + +** Optimizations + +- Limit the use of statements. Try to use expressions instead, or move + the statement out to a function. + +** Findings + +- Having iterators that you can't clone (like stdin) makes certain + things difficult. Eg, doing part 1 and 2 together. +- Using "new type" structs can be a pain. derive_more crate made most + of that pain go away. +- With immutable types, 'reset the machine to try again' type + constraints were handled for free. This made many later puzzles easier. +- The 'no statement' constraint meant that some functions ended up + nested in a way that makes it harder to name and read. +- The persistent data structures don't integrate with Rayon iterators. +- Easier to test subsets, but harder to inspect and audit runtime behaviour. +- Although it isn't frequently used, Rust supports functions inside functions. |