Interesting. Should this be available as a compiler warning in other languages?
Interesting. Should this be available as a compiler warning in other languages?
Compilers should stick to their job: turning human readable code into efficient machine executable code with a minimum of fuss, a maximum of speed and errors where the human readable code leads to either undefined behavior or is simply incorrect.
Enforcing coding styles and documentation requirements should be left to plug-ins for your favorite CI set-up or, alternatively, to stand alone executables or scripts.
The only thing forced documentation will lead to is lots of boilerplate or blank stuff to satisfy the compiler, it will not lead to better documentation.
This is roughly the state of affairs with lots of autodoc docs, it's rare to see good documentation that has been automatically produced but it is very common to see page after page of extremely poor automatically generated documentation. Which then of course gets no love at all because after all, the documentation is already done.
/**
* Gets the thing for the ID.
*
* @param id the ID of the thing
* @return the thing
*/
Thing* getThing(int id) {
return things[id];
}