WHAT
What is Code Documentation?
What is Code Documentation?
Why write Docs?
Saves times, life will be so much simpler, Documentation allows you to transfer faster the why behind code.
If people don’t know why your project exists, they won’t use it. If people can’t figure out how to install your code, they won’t use it. If people can’t figure out how to use your code, they won’t use it.
If you don’t have documentation, you will miss out on a whole class of contributors.
A nice side effect is that you will look again to your code, and make improvement & optimization.
Technical writing is an art that doesn’t come naturally. Writing documentation will start you down the road to being a better technical writer, which is a useful skill to have as a programmer.
Where to put code documentation?
In project structure, first level or particular directory.
Put it in readme, release notes or changelog, deployment guide or installation instruction.
Put it as comments.
Add comments in Version Control.
It is almost impossible without an extreme amount of discipline, to keep external documentation in-sync with the actual code and/or API. Keep things DRY.
Who should write code docs?
How to write Code Documentation?
Code is documentation
API is documentation
Tracking tools are documentation
Version control is documentation
Version numbering is documentation
Javadoc
PHPdoc
Doxygen
Ndoc
Robodoc
etc