Skip to main content
Handbook/Read/Chapter 45 · Code Quality

What Makes It Good

Share

Share this page

Pass it to someone who needs it.

Key takeaway: Good code is code you can change later

Your agent writes code that runs, and a passing demo tells you nothing about what happens next. Working code and good code are different things. Good code is code you can still change six months from now without dreading it. This chapter gives you the small bar that separates the two, and the way to make your agent hold to it on every feature, not just when you remember to ask.

4.7.1Good code is code you can change

The one quality that matters most is that code stays maintainable: easy to read, easy to change, hard to break by accident. Everything else is downstream of that.

Clever code that only its author understands is not a prize, it is a liability. At AI speed you will change this code constantly, so the code that bends without breaking wins over the code that shows off.

4.7.2The few rules that carry most of it

Most of quality comes from five plain rules you can check by eye:

  • Single responsibility: each piece does one job, so you always know where a change goes.
  • Small functions: short enough to read at a glance, not a scroll.
  • Clear names: a name says what the thing is, so daysUntilRenewal beats d.
  • No duplication (DRY): the same logic lives in one place, so a fix lands once, not five times. DRY is short for "don't repeat yourself."
  • Explicit errors: failures are handled out loud, never silently swallowed.

These are the readable slice of a larger set called SOLID, five design principles your agent already knows by name. You do not need to study them. Naming SOLID in an instruction is enough to pull the whole set in.

Rule of thumb: if you cannot tell what a function does from its name and a few lines, that is the code to question, no matter how well it runs.

4.7.3Big file is a smell, not a verdict

A code smell is a surface sign that something might be off, a hint worth a look, not proof of a problem. A file that has grown huge is the most common one.

Size alone does not condemn a file. It is a flag that says look here, then you judge: is this one thing that is genuinely large, or five things that drifted into one file and should split?

A big file is a signal to look; the split decision depends on whether it does one job or many.

4.7.4Make it the agent's standing bar

Asking for quality once is weak. The fix is to make this bar standing, written into the rules file your agent reads on every task, so it applies without you repeating it.

Ready prompt
Act as a senior engineer setting quality rules that apply to every change from now on. Add these to my agent rules file so they hold without me re-asking: - One responsibility per function and file. - Small functions with names that say what they do. - No duplicated logic (DRY); shared logic lives in one place. - Errors handled explicitly, never silently swallowed. - Follow SOLID where it fits. Then review the code below against this bar and list, worst first, what to fix and the smallest change for each. My rules file and the code to review:

Do this now: paste the prompt to fold this bar into your agent rules file, then have it review one existing feature against the bar and hand you the worst offender first.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Contribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license