Wednesday, 7 August 2013

Code Documentation

If you are like me, you like your code documented. At least the important parts. Nothing spoils the day as browsing through hundreds of lines of code in effort to remember what was the original idea behind all that mess. Documentation comments help other people to read your code, ease the maintenance, and, if you do it right, even a decent API reference can be generated from them. So, the time has come to give some shape to my random in-code remarks.

Since I intended to use UnityScript and C#, I wondered what documentation generators (à la javadoc) could be employed. Picking the right choice would allow me to use the correct syntax from the start. I've found [1] that Doxygen is a great option for C#. It supports the standard XML-like syntax as well as its own – shorter and better readable in my opinion –, and it's been here for a while (so it's a really mature tool). For UnityScript, the options are not that great, although the YUIDoc is a solid solution that gets the job done.

No comments:

Post a Comment