Documentation aims at explaining how the code works, and how to use it.
Let's look at some ways to document your code:
comments :- put some comments (something is better than nothing), because it would helpful for your future self, and others who are going to work on it.
providing images, block schemes, diagrams, links and references to cool reference, where it's explained more in details (might be place from where you learned it.)
README files containing all the necessary information about code utilization
release notes/changelogs will help developer to get where the stuff is heading toward what is the recent progress.
Documenting your code is an important skill to have, some need to practice it, and some born with it.
- Saves time, when you next time need to make changes to it.
- helps to refresh your memory
- helps to fix bugs
- allows for version control
- Helps others to go deep into your code, and motivates them to contributes.
- takes a lot of time and patience to write good documentation.
- easily becomes outdated, so needs to be updated all the time
- constant feedback is needed to make it genuinely good which is usually hard to get, for small teams.