Core Developer Skills: Code Qualities

Getting Started

Recommended Book

  • McConnell, Steve. Code Complete: A Practical Handbook of Software Construction. 1993.

Related Videos

  • Scott Bain on Code Qualities
Provide Feedback
What is “good code”? It depends on what you want from it. In the beginning of the software development profession, computers were extremely slow and expensive, and developer time was considered to be a less-critical commodity. Not surprisingly, we did whatever we could to make things easy for the computer to do, even if it made the system very hard for the human developer to work with.

This dynamic has fundamentally changed. Computers are fast, cheap, and software is therefore pretty much everywhere. Developer time is the primarily expense of most development organizations. “Good Code” today, generally, is code that requires less developer time to change, reduces the risk of change, and which will help the system to maintain its ROI for as long as possible.

These are qualities of code that make for more flexible, maintainable and extensible code:

  • Coupling – the connections between units should make sense and be manageable
  • Cohesion – all the parts of a unit should be very strongly related to one another and, therefore, a unit should have a very limited scope of purpose
  • Encapsulation – a unit’s visibility into the details of other units should be as limited as possible to prevent, among other things, accidental coupling
  • Focus – it should be easy to find everything having to do with a single purpose
  • Readability – code should be easy for a professional, up-to-date software developer to read and understand
  • Avoiding Redundancy – anything that needs to be changed should be able to be changed in a single place
  • Testability – how testable something is reflects on the quality of its design and implementation