Arnt Gulbrandsen
About meAbout this blog
2010-07-13

Writing worthless documentation with zero effort

Those lucky enough to use Visual Studio need not work hard to document their code: Ghostdoc does it all automatically. No mental effort required.

Write a function called getBigint(), hit control-shift-d, and ghostdoc writes Gets the Bigint; write one called nextRow() and ghostdoc helpfully documents it as Nexts the row (yes, really).

The ghostdoc site shows how it's done: There's a series of rules and patterns, ghostdoc tries the patterns one by one, and when a function matches a pattern, ghostdoc rewrites the function name/arguments to a full sentence using the corresponding rule.

I suppose such a tool could be useful, if its patterns were good and it would apply more than one pattern. For example: Does the function take an argument which might be null? If so, the tool could look at the code, find out what happens when that argument is null, and insert a sentence saying so. That would be useful, and a good material for PhD thesis too. Although ghostdoc's users and author are, perhaps, not very PhDish.