Ask HN: What is your personal motivation for documenting code?
Hey guys! There's a statement that good code is self-explanatory, still there's a ton of articles in the web describing the importance of documentation. What makes you to write documentation (if you was not asked by the "manager") and what are benefits that you gain as a developer when codebase is well documented?
8 comments
[ 0.30 ms ] story [ 30.1 ms ] thread* Similar input characteristics for a web-based interface.
* Documentation search function and/or auto-complete
Rather than answering the same questions repeatedly, you can point other teammates to your doc.
It’s also not just a one time thing - Once the docs started gaining traction, you will see your teammates contributing. It takes time to get there, but it will get better over time, and it’s worth it.
Downside 1. Docs can get outdated - There will be times you need to go and refactor the docs. 2. You won’t get promoted because you wrote good docs.
Yeah, and that's a statement that has never been true except in trivial cases. Comments and documentation tell the "why", and comments provide additional clarity. Good code tells the "what".
The reason I document boils down to the old saw: be kind to the developer who has to touch the code in the future, particularly because that developer will probably be you.