Long hours driving the open road grant me that rare luxury: time to think about everything and nothing. I love freely associating ideas as the miles roll by. Over a brief vacation this past week, a few ideas collided in my head (somewhere near Story City, IA, if I recall correctly) and stuck together in an amusing way. I'd like to share that with you now—let's have some fun.
I was thinking about mutability, immutability, and systems design. I love immutability in the small. Pure functions over immutable arguments are so much easier to work with than squirmy, stateful goop.
When we use a wider lens, though, it's much less clear how to build full-scale systems that have the same nice properties. For instance, think about a retail system. A shopping cart is just inherently mutable, isn't it? You add stuff, remove stuff, change quantities—those are all mutations, right?