AI Boosts Code Speed, Slows Down System Understanding

AI makes you faster at writing code and slower at noticing what it does to your system. That tradeoff shows up in production, not in the prompt window. Last week I asked an AI to “add optimistic updates” to a React Query mutation. It did the easy part: update cache in onMutate, then invalidate. Looked clean. The miss was subtle: no rollback on error and no cancellation of in flight queries. So a slow refetch raced the optimistic write and we shipped a UI that flickered back to stale data. AI suggested this shape: onMutate setQueryData onError toast onSettled invalidateQueries My review changed it to: cancelQueries in onMutate, snapshot previous, rollback in onError, then invalidate. And we added AbortController to the fetch so retries didn’t stack on flaky mobile networks. Outcome: fewer “it changed then changed back” tickets and a measurable drop in duplicate requests. The AI got us 70 percent there. The other 30 percent was knowing where time and state fight. The real skill isn’t prompting. It’s recognizing the parts of async behavior an LLM can’t feel. #ReactQuery #JavaScript #FrontendEngineering #AsyncProgramming #AICodeReview

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories