It’s 6 AM. The cursor blinks. Another feature, another API endpoint to integrate. The usual grind. Lately, though, there’s a new variable in the equation: the AI assistant humming along in the IDE.
The promise is simple: faster code. Less boilerplate, fewer trips to Stack Overflow for that one obscure `URLSession` delegate method. And for a while, it feels like it delivers. You type a comment, a function signature, and the lines start appearing. Sometimes, they’re even correct.
But here’s the thing about code that writes itself: it doesn’t *understand* itself. And because it doesn’t understand, you have to. Every single line. The real work isn't writing the code anymore; it's auditing it.
Take, for instance, a recent SwiftUI view I needed for a specific data model. I described the data flow, the basic layout, and the AI spat out a few hundred lines. On the surface, it looked fine. The `VStack` was there, the `ForEach` loop, the `Text` views binding to the properties. A quick win, right?
Wrong. The moment you take your hands off the keyboard, the mental load shifts. It's no longer about *composing* the code, but *deconstructing* it. You have to read it with a different kind of intensity. Not to understand your own intent (which you already know), but to understand the *machine's* interpretation of your intent.
This means:
* **Line-by-line semantic check:** Is this `if` condition actually what I meant? Does this `map` operation handle nil values gracefully? The AI doesn't know your app's specific nullability rules or error handling patterns.
* **Architectural fit:** Does this new block of code align with the existing MVVM structure? Did it implicitly create a new `ObservableObject` that clashes with an existing one? Does it use `UserDefaults` when it should be using `Core Data` or `CloudKit`? The AI doesn't have a mental model of your entire application's architecture.
* **Performance implications:** Did it generate an expensive loop where a simpler, more performant approach exists? Is it doing redundant work? The AI doesn’t profile your app or understand its typical usage patterns.
* **Edge cases and error handling:** What happens when the network fails? When the data is malformed? When the user taps twice? The AI often provides the happy path, leaving the crucial robustness to your manual inspection.
* **Security vulnerabilities:** Is it using unsafe string formatting? Is it exposing sensitive data? A slight misunderstanding of context can lead to subtle but dangerous flaws.
* **Testing:** You still have to write the tests. And often, you're testing not just the functionality, but the *AI's interpretation* of the functionality. This can feel like double work.
It's not just the time spent reading, either. It's the cognitive burden of constant skepticism. When you write code yourself, you build a mental model of its correctness as you go. You're the author, the architect. With AI-generated code, you're a critic, a detective. You're constantly searching for flaws, for misinterpretations, for the subtle ways it might lead you astray.
The real value of AI in coding, for us, isn't that it writes the code *for* you. It's that it can quickly provide a scaffold, a first draft, or a reminder of an obscure API. It can save you the initial blank-page paralysis. But that's where its direct utility often ends. The subsequent process of verification, correction, and integration is still entirely human. And it's a process that demands a different, often more intense, kind of focus.
So, when someone talks about AI *writing* code, remember the unspoken asterisk: *…which you then have to meticulously verify, debug, and often rewrite parts of, without the benefit of having built the initial mental model yourself.* The cost isn't zero. It's simply shifted from creation to auditing. And sometimes, that auditing costs more in mental energy than the initial creation ever would have.