Knowledgebase

Code Quality: Everything That Matters, Briefly Print

  • softwareengineering, software, performance, guide, howto, solution, zillionkinghost, hosting
  • 0

The summary.

CODE IS READ FAR MORE OFTEN THAN IT IS WRITTEN

So optimise for the reader. Clever code costs time every time anyone reads it, including its author six months later.

Ask before submitting: would someone unfamiliar understand this without asking me?

NAMES ARE HOW CODE EXPLAINS ITSELF

Name by purpose, not implementation. A name that lies — a function that retrieves and also changes — causes bugs because callers trust it.

Difficulty naming something signals it does too much.

IF A BLOCK CAN BE NAMED, IT IS A SEPARATE RESPONSIBILITY

Extract it. And use early returns, which put the main path at one level of indentation.

REFACTOR CONTINUOUSLY IN SMALL STEPS, NEVER AS A PROJECT

Large refactoring projects are cancelled. Leave code slightly better than you found it each time — and never mix refactoring with behaviour changes in one commit.

KEEP REVIEWS SMALL

Large changes receive superficial review, reliably. Distinguish what must change from what you suggest, or every comment appears to be a demand.

INTERMITTENT TESTS TRAIN PEOPLE TO IGNORE FAILURES

Which defeats the entire purpose of having them.

AUTOMATE FORMATTING ENTIRELY

It ends style discussion permanently and removes it from review.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot