Comment complexity, or lack thereof, reveals understanding (Score 1) 381
I have been a software developer for about 30 years. I have written a lot of code and maintained a lot of code written by others.
I have found that when I understand a problem I can reduce the complexity of the code I write; one measure being number of lines.
I have read other people's code and been amazed by the simplicity possible when solving a complex problem.
I have also gotten headaches from reading code that is very complex that doesn't need to be. Often such code came from self-educated software developers.
Based on these experiences I came up with a maxim: The complexity of a solution is inversely proportional to the understanding of the person who created it. In other words, the better a person understands the problem to be solved the simpler the solution will be. That doesn't mean that a solution is simple, but it does mean that it is understandable. I have yet to encounter a situation, whether it be software, or organizational issues, or pretty much anything that people can do, to which this maxim does not apply.
Another measure is can the developer explain the code? I have had developers tell me that I will never be able to understand the code they have written and then made no attempt to explain the code. All that communicates to me is that they do not understand what they wrote.