The list below is not comprehensive, but these are the things that I thought of in considering your question.
-
Good code is well-organized. Data and operations in classes fit together. There aren’t extraneous dependencies between classes. It does not look like “spaghetti.”
-
Good code comments explain why things are done not what is done. The code itself explains what is done. The need for comments should be minimal.
-
Good code uses meaningful naming conventions for all but the most transient of objects. the name of something is informative about when and how to use the object.
-
Good code is well-tested. Tests serve as an executable specification of the code and examples of its use.
-
Good code is not “clever”. It does things in straightforward, obvious ways.
-
Good code is developed in small, easy to read units of computation. These units are reused throughout the code.
I haven’t read it yet, but the book I’m planning to read on this topic is Clean Code by Robert C. Martin.