Search My Blog

Monday, July 25, 2011

Doxygen Magically Turns Source Code into Documentation | Wazi

Doxygen Magically Turns Source Code into Documentation

By Carla Schroder on Monday, July 25th, 2011 in Technical | Related Software Packages: , | Keywords: ,

Few programmers enjoy writing software documentation, though the quality of their lamentations on the subject indicates that many are talented writers. Good source code documentation takes time and effort, and it’s essential, so what’s an overworked coder to do? Look for tools to make it easier, like the Doxygen documentation system. Doxygen generates documentation directly from source code. It supports multiple output formats, such as HTML, PDF, RTF, man pages, and LaTeX. It works out-of-the-box with C++, C, Java, Objective-C, Python, IDL, Fortran, VHDL, PHP, C#, and D, and community members have written helpers for other languages such as Perl, JavaScript, Visual Basic, Object Pascal, VB.Net, and TCL.

Doxygen is not quite magical, though it comes close. To use it, you simply document your program with good comments in a form that Doxygen understands. Doxygen then parses the code and comments and transforms them into nicely formatted output files. Using comments as documentation keeps everything in one place, making life easier for hard-working coders.

Doxygen also has the ability to extract the code structure from uncommented source code files, which is a wonderful thing when you’re trying to understand strange code (including your own).  Doxygen understands the code; it is much more than just a another set of formatting tags.

Let’s roll up our sleeves and use a simple example C file to show how Doxygen works. It is traditional for beginning developers to start by creating a “Hello, World!” program, and who are we to break tradition? Create a directory to store your project files and save this code as hello.c:


If I were a Coder... I think I'd like this one!:)


No comments: