Readme.txt
Hardly ever read, but often useful information
Creating good documentation
As a developer that primarily learns by reading documentation, I have an great appreciation for it. In fact I probably wouldn't know anything about Django, Python, or Javascript except there are an abundance of people writing about them.
So you would think that my appreciation would convert into active documentation of my own code. Unfortunately, it hasn't.
Recently, I've been working to provide documentation for much of the code I've written during the last two years. It's been a challenge to say the least.
The first challenge has been to determine the style of documentation. A friend has consistently complained about Django documentation, because it reads more like a how-to manual instead of function-by-function code review. He thinks good documentation should explain each function, what it accepts as args and kwargs, and what it returns. Python documentation basically follows this standard as does most PHP docs.
What's I've determined so far is that both things have a purpose. A good explanation of how to use an application, setup, and examples of use are really useful. What is great about Django documentation is the readability. You can read through an application's documentation and get a good idea of the application's purpose, best uses and some example of functionality. However, there are lots of functions that are not even mentioned. When trying to leverage the tools available you are left reading code and attempting to figure out what each function adds to the whole
In contrast a function by function method often doesn't have enough examples of use. These brief notes on each function are also not necessarily easy for beginners to understand.
There's some middle ground. So I've begun my documentation adventure by taking each application and writing a Django style instructional. One addition is an explanation of "why" things are done in a particular way. In our custom code, sometime feature creep leads to complicated additions. It's best to tell other developers why and how things were added so they can go into future discussions prepared with a history of the application.
After getting a baseline of explanation, I plan to go back and take a function by function approach. This is especially important for those functions that provide special information or are expensive on the servers.
Maybe by Christmas I'll be satisfied that an other developer can come in an take my code to the next project or even the next level. I'm almost as proud of that as I am that my code provides a service to our employees and customers today.
