Day 179: The Unhappy Purist

I spent all of today relearning how Redux works (I used it for building SlowTube 9 months ago but haven’t touched it since) and adding it to Browserflow to manage some of the application state.

Now I’m paralyzed.

All the code I’ve written so far uses a set of utility functions and custom React hooks that I’ve developed over the last year of developing Chrome extensions. They’ve worked really well, and I’m proud of how easy they make it to interact with the WebExtensions storage API and manage state.

But you know what else manages state? Redux.

Now I have two quite different ways that state is managed, and I feel like I’ve been asked to use semicolons for all lines of code that are odd but leave it out for the even ones.

While I could leave it be and use both methods, the overlap in functionality as well as the duplication of logic involved is seriously bothering me.

The purist in me is insisting that if I am going to use Redux, I should embrace it all the way and convert all of my state management to use it. The indirection and boilerplate introduced by Redux is certainly annoying, but the benefits of improved predictability and introspection are hard to deny.

I also discovered webext-redux today, which is a set of utilities built just for making Chrome extensions work well with Redux. I felt paralyzed when I came across it because it made me question whether to continue with my current approach or try to adopt it. There was a part of me that wanted to find significant downsides with the library so I can justify sticking with what I have, even though rationally, I should be stoked to discover ways to improve my toolkit and development process. Sunk cost fallacy is a doozy.

Sometimes the purist in me feels incredibly helpful because it helps me pay attention to details and build great experiences instead of half-assing things, but in other times like this, it feels like pure sabotage.

Maybe I’ll do an in-depth comparison of the different approaches and hope that it helps me decide. But is that really the best use of my time? Will I even find a decisive answer?

Meep.