I can’t scientifically say what makes code “good”, but my gut has a few things to say about it:

  1. good code reflects the problem it solves
  2. good code can be easily understood by programmers without experience in your language
  3. good code is generally short
  4. good code doesn’t require much thinking to understand
  5. good code has very little coupling
  6. good code is cohesive - definitions of functions and types required are not scattered throughout the software
  7. good code documents any requirements for proper usage
  8. good code makes just as much sense to you one year from now, as it does now

All of these properties I feel could be summed up simply as: “good code is reusable”, and taken a step further: “really good code is so simple it can be reused by a trained seal.”.

What do you feel are other properties of good code?