Fundamentals 11 min read

What Makes Good Code? Standards and Characteristics for Quality Software

The article explores the criteria that define good code—feasibility, timeliness, adaptability, efficiency, and a comprehensive set of quality attributes—drawing on Gerald Weinberg’s insights and offering practical guidelines for writing maintainable, readable, and robust software.

Architect
Architect
Architect
What Makes Good Code? Standards and Characteristics for Quality Software

Many developers complain about poorly written code—missing comments, magic numbers, tangled logic, and frequent bugs—and wonder what truly constitutes "good" code.

After reading Gerald M. Weinberg’s *The Psychology of Computer Programming*, the author suggests that the answer varies by context but can be explored through a set of universal standards.

"Your code this week is better than last week, this month is better than last month, and this year is better than last year. In other words, you should write the best code possible for the time."

The first standard is feasibility : a program must produce the expected output for any defined input; without feasibility, performance or scalability are irrelevant.

"If a program cannot run correctly, evaluating its efficiency, adaptability, or cost is meaningless. All large, important programs contain flaws, so assessments must consider imperfection."

The second standard is timeliness : delivering software on schedule often outweighs potential efficiency gains, as unpredictable delays can disrupt plans more than a slightly slower but reliable release.

The third and fourth standards are adaptability (extensibility) and efficiency . Adaptability enables future modifications, while efficiency concerns runtime performance; they often trade off against each other, as illustrated by Fisher’s theorem that strong adaptation to one environment reduces adaptability to new ones.

"During a software’s lifecycle, most programs are modified. Yet few original authors consider future changes, leading developers to rewrite rather than refactor."
"If we focus on efficiency, we may produce tightly‑coupled code that becomes hard to modify later, sacrificing portability and maintainability."

The author concludes that efficiency is becoming less critical as hardware costs drop, and that interview processes often over‑emphasize performance at the expense of correctness.

Based on GPT’s synthesis, good code should exhibit the following characteristics:

Readability : clear naming, structure, and comments.

Simplicity : no redundant or overly complex logic.

Maintainability : modular and easy to upgrade.

Extensibility : flexible design for new features.

Robustness : proper error handling.

Performance : efficient execution without waste.

Security : free of vulnerabilities such as SQL injection or XSS.

Compliance : follows language and project coding standards.

Documentation : comprehensive comments, API docs, and manuals.

Test Coverage : thorough unit and integration tests.

Reusability : well‑encapsulated functions/classes.

Version Control : managed with systems like Git.

CI/CD : automated testing and deployment pipelines.

User‑Friendliness : good UX when applicable.

Portability : runs across environments without hard‑coded dependencies.

Comment Quality : clear explanations of intent.

Appropriate Complexity : balanced to problem domain.

Dependency Management : explicit and up‑to‑date.

Resource Management : proper handling of memory, files, connections.

Code Review : peer inspection to catch issues.

While the exact importance of each attribute may differ per project, this list provides a general guideline for assessing and improving code quality.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

best practicescode qualityprogramming standards
Architect
Written by

Architect

Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.