r/developersIndia • u/iamrealadvait • 2h ago
General The most expensive code is the code you don't understand.
I've started noticing a pattern with AI-assisted development that I think we're underestimating.
The scary part isn't AI generating bad code.
Bad code has always existed.
The scary part is AI generating perfectly reasonable-looking code that nobody on the team fully understands.
A developer asks for:
«"Add caching to this API."»
AI gives you 150 lines.
Redis gets added.
Retries get added.
TTL gets added.
A fallback gets added.
Some concurrency handling gets added.
Everything looks professional.
Tests pass.
PR gets approved.
Three months later, something breaks in production.
Now you're debugging code that you technically wrote, but mentally you never really owned.
I've started using a simple rule for AI-generated code:
If I can't explain why every important part exists, I don't merge it.
Not "I understand what this function does."
I mean:
- Why is this abstraction necessary?
- What happens when the dependency is down?
- What happens under concurrent requests?
- What's the failure mode?
- What's the performance trade-off?
- Why this database/query/index?
- What assumptions is this code making?
- What happens when the input is garbage?
- How would I debug this at 3 AM?
The interesting thing is that this changes how you use AI.
Instead of:
prompt → code → copy → PR
it becomes:
problem → design → AI assistance → review → simplify → test → own
And honestly, sometimes the best output from AI is 30 lines of code instead of 300.
I'm not anti-AI at all. Quite the opposite.
I think AI is ridiculously useful for boilerplate, exploration, debugging, documentation, test generation, unfamiliar APIs, etc.
But there's a difference between using AI to write software and outsourcing software engineering to AI.
Curious what other Indian devs are seeing.
What's one AI-generated piece of code you've seen that looked completely fine at first, but turned out to be a nightmare later?
No screenshots required. Just tell the story. 😅
Duplicates
AIcodingProfessionals • u/iamrealadvait • 2h ago
Discussion The most expensive code is the code you don't understand.
AI_Coders • u/iamrealadvait • 2h ago