No automatic processing can replace human culture.
Think of this: if you add comments to existing code, the situation is simple: if this is done automatically, this comment is
trivial and hence useless. I actually can see only one exclusion: I find it convenient if all end-of-block places ("end", "}") are commented to match the beginning, and even this is questionable. I find it extremely irritating when I see a standard comment block before every type and method. This is a typical example:
void InitializeUi(
ScenarioGenerator scenarioGenerator,
LogicEngine logicEngine,
ScenarioGenerator scenarioGenerator,
SkinManager skinManager) {
}
It only pollutes the code and irritates the reader, nothing else. It tells you what you already know. The generation of this comment itself
can be useful, but only if the developer adds some useful information to it, that it can go, for example, to XML documentation. But even this should be done very rarely, to select public entities.
At the same time, some minimalistic comments of the auto-generated code is useful, but you are talking about developers' culture, so this is not your concern, as I understand.
This should give you the idea that
automatic commenting is evil. It still can be useful, but only if it is
mediated through proper development culture. Remember old saying:
code should be self-commenting. Indeed, some rare comments should be added, by a hand of a master of comments. So, if the idea to "enforce" commenting came to your mind, how about thinking at this: do you have this culture yourself?
I can tell you what can happen without such culture. The developers will simply ignore the automatic commenting. This commenting will either not appear at all, or,
much worse, will be there, purely automatic, untouched by a developer's hand. And of course
you won't be able to "enforce" anything.
—SA