April 21, 2003

Self Documenting Code

I have just come across and old Post-It note with an idea scrawled on it that I am going to note down, in this my backup brain.

I had the idea that all classes should implement SelfDocumenting and have a method getDocument so after a build. A tool could examine all the built classes and recreate the documentation from them. Add this in the code might make the class overlong, maybe classes should also have a companion Documentation class as well as a test class. Though, you do then get into the issue of whether some methods need to be public or package private for the sake of the documentation.

Posted by stuartcw at April 21, 2003 03:48 PM
Comments