Redux maintainer's thoughts on AI
Redux maintainer Mark Erikson shares his personal journey from initial fear and skepticism of AI in programming to a more nuanced perspective. After his company Replay pivoted from time-travel debugging to AI, he experienced deep frustration but eventually found value in AI as an assistant despite ongoing concerns about determinism and understanding.
My own personal thoughts and opinions on AI effects and usage, and how those have evolved over time
Introduction 🔗︎
This post will be tough to write. There's a lot of discourse and arguing about AI everywhere you look. I've read it all. I don't want to get caught up in arguments, get misinterpreted, or be labeled with beliefs that don't apply.
I am not e/acc or P(doom). I am a software engineer, I am a person, trying to figure this out same as everyone else.
I am not trying to sell anything, change anyone's mind, or say I am an expert. I don't have the answers.
I do have thoughts, opinions, fears, excitement, and concerns. I've shared a lot of them in private. Enough people have heard those thoughts and said they want to hear or read more about my opinions that it seems worth my time to write them up publicly. A lot of these aren't original to me. I don't claim to be a deep thinker. I have read a lot, thought a lot, synthesized a lot.
So, here's my story and opinions, from the heart, best as I can write them. So many points I could make and articles I could cite as references here, but this one's just me. My story, told my way. A lot of you are probably going to see the length and yell "TLDR" and nope right out of here, or throw it in an agent to summarize. That's fine. Take it for what it's worth. Maybe this helps someone else. (and if you want to skip to the tech workflow post there you go.)
Introduction
Part 1: The Before Times
Programming Is Life
Clouds on the Horizon
Ominous Signs
Part 2: Fear, Doom, and Depression
The Pivot
The Wilderness
The Tidal Wave
P(doom)
Depression
Part 3: Reverse Engineering
Miami Sunshine
Flipping The Bit
Part 4: Taming the Beast
Architectural Research
Mind. Blown.
Part 5: Diving In
Ramping Up
Immer
Nerd-Sniped
Self-Reflection
Part 6: Liftoff
Trust Factor
Gearing Up
The Re-Pivot
Part 7: Warp Speed
Pulling It All Together
Pattern Matching
Shipping for Agents
Part 8: So What Do I Think Today, Anyway?
Most Of My Fears Are Still Valid, And So Are You
The Tiger Is Out
Gotta Go Fast
Oops It's Capitalism
Maintainability is the Mindset
But Non-Determinism?
Is This Actually Better?
What About the Craft?
Final Thoughts
Part 1: The Before Times 🔗︎
Programming Is Life 🔗︎
I love programming. I love the problem solving, the thinking. Getting in a flow state, trance music cranked up, deep in the code, surfacing hours later and seeing that this feature didn't exist at the start of the day and now it does and it's all because I figured out how to do it. Debugging deeply. Trying to understand the guts of an unfamiliar system, figuring out where things were going wrong, finally nailing the tweak or architectural change that fixes the problem. Learning new tools, unlocking new capabilities.
I've been programming for 25+ years, over half my life. I cut my teeth in the early days of the Agile Manifesto. I read Joel Spolsky and that rewriting a system from scratch was a bad idea. I read the HN debates about how to interview programmers. I read the 8th Light and Uncle Bob discussions about "Software Craftsmanship" and honing our skills. I never spent time doing code katas, but clearly craft mattered. Writing code the right way mattered. It wasn't just about whether the code ran. It was whether the code was elegant, clean, readable, maintainable. "Make It Work, Make It Right, Make It Fast" became my mantra. "Tradeoffs" was my favorite keyword.
I built my career on deep understanding. I firmly believe that "programming is building a mental model of the system". That every programmer's job is really to understand the problem domain and the system they're working on, that you break down a new feature or bugfix by comparing it to your existing understanding of the system, and that at the end of a 6-hour coding session you've not only written working code but you've shaped a new and improved understanding of the existing system plus the changes. That you learn the fundamentals of your tools, go into the next layer of abstraction, dig into unfamiliar code, learn on the fly.
I believe in determinism. That pure functions aren't just an esoteric concept, but make code predictable and testable. That you can understand a system, even if there's distributed pieces and timing problems and race conditions. That you can solve a problem by taking the time to understand it, break it down, build the mental model, scientific method debug the solution, document it, maintain it. Redux wasn't just a way to manage data outside React, but a way to make the data flow predictable. That the Redux DevTools should show a meaningful human readable history of what happened in the application.
And then came AI.
Clouds on the Horizon 🔗︎
Dunno when I first started hearing about using AI to write code. Probably somewhere in the GPT-2ish era. Surely read it somewhere on HN or Reddit.
I think the first real examples I saw of actual AI-generated code were from Github Copilot as a VS Code extension. I'd always been an IDE user, all the way back to the Visual C++ days. (yes yes I know some of you predate that considerably, same as folks who used Amigas and C64s predate my first 286 and DOS 3.3 usage. My story here.)
IDE autocomplete is ancient tech. Whether it was VC++, Visual Studio C#, Eclipse and Java, or fine even you Vim/Emacs people with some custom plugin, we've always been able to type person. and see firstName, lastName, age pop up in the autocomplete overlay. Simple and deterministic. Sometimes we rely on it too heavily, but no one can memorize all the available methods anyway.
AI-powered "autocomplete", though? That's... something different.
I resisted at first. I didn't want a non-deterministic tool trying to offer "suggestions". I knew what I wanted to write. I didn't need some Statistical Word Generating Machine trying to somehow guess what I might want to do next.
My work journal says I finally gave in and decided to try Github Copilot in March 2023, and concluded: "It's... not awful? It's doing a decent job being a smarter Intellisense so far."
So I left it on. Got some use out of it. Two thirds of the time the suggestions were completely bogus, but at least it was limited to trying to suggest a couple lines of code at a time, maybe outlining a for loop or something. Scoped. Readable. I could see the suggestions, I could ignore them, I only had to accept them if they actually were what I was about to type in. Still under my control, my understanding.
I do remember one incident where I was working on some perf optimizations for Reselect, and hijacking some of the unit test files to run perf tests. I hit Enter a couple times and paused... and it suddenly "suggested" an entire multi-paragraph comment about doing performance analysis and even referenced some repo that might not have existed yet, but was eerily relevant conceptually. That was kinda funny! ... and also scary.
Ominous Signs 🔗︎
I started hearing about devs using this tech on a larger scale. Just repeatedly auto-accepting suggestions, or doing more. Seemed.... wrong. It's non-deterministic. These things hallucinate. Surely you can't rely on that for anything real, right?
I started seeing more and more evidence of AI-generated code and text popping up online. These frequently seemed to involve hallucinations. A couple incidents particularly stick out in my mind.
In one case, a dev pinged me on Twitter saying that a link to my blog was producing 404. The URL was something akin to https://blog.isquaredsoftware.com/YYYY/MM/blogged-answers-selectors-fetching/. Not quite that, but close enough. I checked, got a 404. Confused, I went to my blog repo, looked for that Markdown file, and it didn't exi..... waitaminute. I don't remember ever having written a post with that kind of title. Where'd they get that link? and sure enough, an LLM had utterly hallucinated a URL to my blog for a post that did not exist. Gotten the URL format correct and everything. Completely wrong.
Another time, a user asked in the Redux Discord channels about some Redux APIs, with code snippets... and those APIs also did not exist. Asked, and sure enough, same thing. They asked an LLM, it gave them the snippet, they never checked and just believed the answers and then the suggested code was completely bogus.
Small sample size, but examples of the larger pattern I was seeing. Clearly, LLMs could not be trusted! Too many hallucinations.
I think I even tried downloading a local LLM setup once or twice. Tried asking something about "Redux vs Flux", took a very long time to generate tokens, and came up with a vaguely plausible sounding but completely incorrect answer paragraph.
At this point every single indicator I had seen was telling me this technology simply could not be trusted. It's one thing to copy-paste some snippets off Stack Overflow and maybe the answer's wrong, but at least there it's a person that wrote that. AI code would never reach any acceptable level of trustworthiness. It's non-deterministic! It hallucinates! There is just no possible way you can safely build maintainable systems on this kind of flawed foundation.
Part 2: Fear, Doom, and Depression 🔗︎
The Pivot 🔗︎
I had joined Replay in spring 2022. Time travel debugging. It was the perfect fit. It matched everything I believed in in my career, every experience I had. Amazing team, brilliantly talented engineers. An impossible tool, already working. The hard part's done! We've built time travel! We've brought determinism to a non-deterministic world! A perfect product, blindingly obvious how useful it is. It'll save every web developer thousands of hours. I wish I'd had this years ago in my career. A codebase using React and Redux that I'm already familiar with. No possible way this could go wrong. Won't be a rocket ship, but steady growth on the way and we'll succeed.
We were wrong. I was wrong.
Turns out there's many aspects we never accounted for. Most devs are never taught how to debug. We learn it on the fly, by osmosis, as we go. No one approaches it scientifically. No one uses existing graphical debugging tools like Chrome DevTools or VS Code's debugger. It's just spam some more console logs and reload the page. Trying to sell a more powerful graphical debugger just didn't work the way we assumed it would.
I had spent all of 2023 getting to build amazing time-travel powered debugging tools. Our React and Redux DevTools integrations. "Jump to Code", going from a click event to the React onClick prop that handled it and pausing when it ran. I was a kid in a candy store, an entire toolbox of amazing time travel APIs at my fingertips. I was having a blast. I was building incredible tools now, but surely these were just the foundation for what we'd get to build on top 10 years from now.
But, turns out that just building the world's most amazing tech doesn't automatically bring in sales. We struggled. and in summer 2024, we pivoted.
The pivot was a brutal blow. I never saw it coming. And not only were we throwing away the dream of time travel debugging, the dream that I'd believed in, the dream I wanted to spend the rest of my career building...
we were pivoting to AI.
In that moment I felt, quite literally and physically, like I'd been punched in the gut.
And I had the most visceral gut reaction I can ever remember:
"HELL NO! I will never work on anything AI related!"
The Wilderness 🔗︎
Post-pivot, Replay regrouped and tried to figure out what we could do. I busied myself working on our React analysis layer. Outside work, I spent a few months working on RTK Query's infinite query support.
But at least those tasks were things I could do by hand. With my own brain. I dug through the ReactDOM artifacts and found the relevant functions to instrument. I looked at the instrumented minified bundles and found the places where we were inserting callbacks the wrong way. I went through
[truncated for AI cost control]