Ask HN: How do you document your code at work?
This has been different at literally every company I've worked at, and it's never been good.
Specifically curious about how internal technical/code/product documentation is written and maintained.
If you like the internal documentation at your company: what's so great about it?
5 comments
[ 4.4 ms ] story [ 23.5 ms ] threadhttps://www.truecar.com/battery-pack/introduction
To be clear, if docs are just translating to English what the code is already expressing then they are bad. They should be high level, explaining odd cases, etc. If they go out of sync, you fix them because your future ability to understand the code depends on it.
I've had PR's rejected because they only added comments saying that "they will get out of sync". I've had documentation projects canceled because "they will get out of sync". It makes me really sad when a new hire struggles to understand basic things in our code base. </rant>
The flow of code and detailed comments about it right there in the flow help the readability of code. Also it's easier to change the comments when code changes because its all there in a single file. Makes reviews easier.