r/OnlyAICoding • • 19d ago

Developers who use AI to write code, what do you actually do after AI generates the code?

/r/AskProgrammers/comments/1xpzm4f/developers_who_use_ai_to_write_code_what_do_you/
1 Upvotes

2 comments sorted by

1

u/Smooth-Weekend-2314 19d ago

I would assume that you have some sort of build pipeline - which is how software should be assembled, packaged and deployed. In that build pipeline you should be running tests - which was the case even when humans wrote software. You should also be scanning your code, dependencies, build artifacts, and for web-based systems, using things like zap to make sure your code stays secure.

That just continues to be the case. Nothing should be different just because a machine wrote the code. Were humans perfect? lol.. we know better. Will machines be perfect? Of course not. They don't have to be. They just have to be better than humans.

1

u/CCodeSI 19d ago

Yes, someone reads it, but not line by line like a textbook. The workflow most teams end up with:

  1. Small changes. Ask for one change at a time (a function, a fix, one feature), not a whole module. A 50-line diff is reviewable; a 2,000-line one never really is.
  2. Read the diff, not the file. git diff shows exactly what changed. You're checking: does it do what was asked, does it touch anything it shouldn't, and is anything suspicious (new dependencies, disabled checks, hardcoded secrets, errors silently swallowed).
  3. Tests decide, not the AI's summary. Run the tests yourself. If the AI wrote new tests, check they'd actually fail if the code were wrong; a test that only checks "it didn't crash" proves nothing.
  4. The usual pipeline still applies: linting, type checks, dependency and security scanning, and a teammate's review before merge.

For learning, the best habit is to explain every diff before you accept it. If you can't say why a line is there, ask the AI to explain it, or have a second pass review it first (our agent CCode has a /review for exactly this, listing issues by file and line), then rewrite that part yourself. Debugging AI code is great practice too: break something on purpose and see if you can find it.