4 ms·
I wait to write full docs, but while programming I write standard doc comments at the package and function level for every package and function I write. What I'
by ilovecaching 7y ago
I wait to write full docs, but while programming I write standard doc comments at the package and function level for every package and function I write. What I've learned working at small companies, FAANG, and on my own is that the cost to read code is high, and internal bias that our code is understandable is incredibly powerful. Writing my intentions in English is a small piece of up front overhead I have made mandatory, because I wish other people would have made it mandatory when I'm trying to jump into a code base without docs.
I've also gotten better at writing comments, and write them faster because I have so much practice. If you don't do something that often, you're bound to suck at it, and that's true of people who think they're going to write the world's best comments and documentation as soon as their project is settled. The truth is that most programmers are terrible at comments because they treat them with such disdain and don't take the time to get better at it just as they got better at writing code.