Archive for November 18th, 2004

GhostDoc

Thursday, November 18th, 2004

I just downloaded GhostDoc and I am extremely impressed. GhostDoc is a great step towards providing consistency in comments. I was amazed to see how wonderful a little bit of intelligence and automation can help with readability of the code and the resulting documentation.

When you right click in the following code block and choose “Document This“ from the context menu…

1:     public bool CanRestart()
2:     {
3:         return false;
4:     }

You get this…

1:     ///
2:     /// Determines whether this instance can restart.
3:     ///
4:     ///
5:     ///     true if this instance can restart; otherwise, false.
6:     ///
7:     public bool CanRestart()
8:     {
9:         return false;
10:    }

Ghostdoc also provides configurable rules that you can use to customize the behavior and the resulting comments.

I’m a big fan of automating documentation and I’ve seen a lot of momentum in this space lately. In a perfect world we would either write code or write documentation, not maintain the two side-by-side. The generation could obviously go either way, but until I see a solid MDA product I think I’ll continue to have the code generate the documentation. NAnt and NDoc do a wonderful job of generating documentation during a build and the setup is quick and easy. I have also used NAnt and the BizTalk Server Documenter to generate documentation for BizTalk projects lately.

It puts a big smile on my face when I can provide everyone with technical documentation that I know is up-to-date.