How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view, the code is readable and maintainable, because the author wrote it and edited it, to begin with. However, there must be an objective and quantifiable standard by which our profession can measure code.

These goals are met when one may do the following with the code without the expert advice of the original author:


It is possible to read the code and understand at a basic level the flow of logic.
It is possible to understand at a deeper level what the code is doing to include inputs, outputs, and algorithms.
Other developers can make meaningful changes to the original code such as bug fixes or refactoring.
One can write new code such as a class or module that leverages the original code.


How do we quantify or measure code quality so that we know it readable, understandable, and maintainable?

Your peer tells you after reviewing the code.

You cannot determine this yourself easily because as the author, you know more than the code says by itself.  A computer cannot tell you, for the same reasons that it cannot tell if a painting is art or not.  Hence, you need another human - capable of maintaining the software - to look at what you have written and give his or her opinion.  The formal name of said process is peer review.
