AI tends to write brittle code that does not consider edge cases, business-specific use cases, or maintainability.
It simply writes way too much code. The more you rely on it, the higher it will layer on code that acts like a house of cards until eventually…
It falls over.
Remember this simple rule of code: more code == more surface area for bugs
Here are my hard-and-fast rules for when to use AI vs when not to use it.
- Tedious work that I can easily do but will take a while like updating types in a TypeScript project or breaking up a large component into multiple components.
- UI updates. Drag and drop an image and have AI do its best to get you started.
- Prototyping. This is where AI really shines. If I’m curious what a large refactor might look like I can just have Claude or Cursor start it off. A proof-of-concept is a perfect use case or any scenario where you don’t care much about code quality.
- Bug discovery. From code reviews to thought partner — I will ask Claude or Cursor to poke holes in my logic, ask if I missed any edge cases or suggestions on database schemas. It’s great to either validate my ideas or challenge my assumptions.
- Code whisperer. I work at a small company and often look over work from our data scientists. I use AI to verify my understanding and explain mathematical concepts that are beyond my simple brain.
Now here’s when I tell my little code monkey to kick rocks:
- Anything mission critical. If the code breaking means a severe incident might occur then that is generally off limits.
- TDD. The jury is still out here but I’ve noticed a very sinister phenomenon when AI writes tests for it’s own code — it cheats! Hard-coded return values. Mocking the functions it’s supposed to test so they always pass tests?! Pure insanity and now you can’t trust the code OR the tests.
- When I want a simple solution. I don’t need a rate limiter for this API in an internal web app. I certainly don’t need a README for every component. I don’t need a useless comment above every line of code.
—-from
https://brianjenney.medium.com/coding-in-the-age-of-ai-what-no-ones-telling-you-c5fa414cee06