Opening Day on the Deschutes, and What I Was Actually Thinking About
Got out to the river for the first time this season. Didn't catch much. Thought about component architecture for four hours. A good day.
The Deschutes River in early spring, clear water over volcanic rock
I drove down to the Deschutes on opening day with a 5-weight rod I've had since college and a box of elk hair caddis that were probably older than my career in software. The river was high and a little murky — not ideal — but it didn't matter. I wasn't really there to catch fish.
I mean, I was. But also I wasn't.
There's a thing that happens when I get on the water where the part of my brain that's usually clenched just... opens. I'm not thinking in language anymore. Problems that felt stuck start moving again. I'm not sure if it's the sound of moving water or the particular kind of attention fly fishing demands — you have to be present without being tense, which is harder than it sounds — but something shifts.
What I was actually thinking about for most of those four hours was a component architecture problem I'd been stuck on for two weeks.
The problem
I had a set of UI components that needed to share state, but the state wasn't hierarchical — it was lateral. Three siblings that all needed to know about each other without the parent becoming a god object. I'd tried context, I'd tried lifting, I'd tried a little event bus thing that felt immediately wrong.
A fly fisher wading in a river at golden hour, rod arced mid-cast
I was standing in the river in cold water up to my knees, watching a trout rise thirty feet upstream that I was never going to reach with my current position, and I thought: you're trying to solve this top-down. Stop.
The answer — obvious in retrospect — was to invert it. The components didn't need to share state. They needed to subscribe to the same derived state from a single external store. I'd been thinking about it as a distribution problem when it was actually a synchronization problem.
Back to the river
I caught two small fish and released them both. Drove home with the windows down.
The component thing was fixed by nine that night.
There's something worth noting here, even if it sounds trite: the best thinking I do is never at the desk. The desk is where I execute. The river, a long walk, the forty minutes before I fall asleep — that's where the real work happens.
I don't fully understand why. Something about diffuse attention versus focused attention. The problem has to cook without you staring at it.
The fish doesn't care about your state management problem. That's the whole point.
I'll be back out next weekend if the flows cooperate.