Weeknotes № 40

Taking Time Off

I’m taking some time off this month to focus on the family and get the final home improvement bits done before winter is here. I am working on some small side-projects and we will run a workshop this week.

One of the things I experimented with is a generic programming library. This allows you to view your structs and enums as sums of products, and makes it relatively easy to write algorithms that operate on the structure of these types. For example, I’ve written a binary encoder/decoder, a method that generates a simple SwiftUI view for a type, a method that generates an editor (form) for a type, and a bunch more. I’m currently trying a few different approaches and am planning to blog a bit more about this soon. If you’re interested, here’s a repo with some of my experiments.

In the typing recorder project that I wrote about in previous weeknotes, I started with a simple enum-based model layer. I was too lazy to make my model values Identifiable but just had an array of enum values with the array index as the identifier. As always, this came back to haunt me. I finally changed my representation to include a stable identifier. This would have been much less work if I had done it from the beginning.

I went for a quick dip in the lake after my long run on Sunday — it’s doable, but far from comfortable. Part of me wants to keep doing that, but I’m not sure how long I’ll last this year.