3 ms·
> because I have to understand it when I come back The hard part is understanding why the code does what it does. Which is why documenting the reasoning behind
by zzzcpan 9y ago
> because I have to understand it when I come back
The hard part is understanding why the code does what it does. Which is why documenting the reasoning behind the choices is much more valuable than the code itself. Why did you choose that particular algorithm and why do you use this particular convention for naming things, etc. Documenting conventions is also important, they are not obvious and let you keep consistency of the code next time you touch it, so you don't introduce time wasting edge cases that require learning and dealing with useless things.
- pmontra 9y agoI document those reasonings in wikis (example: on github) or Markdown files checked in to the repository. For normal stuff choosing the right names is enough. Example: number_of_customers leaves very little doubts, customers could be many different things. Autocompletions in editors helps because it doesn't increase the number of typed characters.