&gt; But the problem with comments is that they&#x27;ll inevitably get out of sync with the code.<p>Eek, then by all means take comments seriously and change them when your code changes. I think it&#x27;s particularly important to comment functions and methods (especially effectful&#x2F;stateful ones) with what precisely they&#x27;re expected to do, what invariants hold, etc. (insofar as the type system and function name don&#x27;t make these clear). Otherwise another programmer has no way (aside from looking at and completely understanding every call site) of knowing what bits of the functionality are incidental vs intended behavior, and are likely to make small modifications for their own purposes which break other things.<p>Programmers seem very eager to lack of comments and I&#x27;m super unsympathetic; this is the one thing that just kills me. Comments hold together a codebase, make it much easier to learn and read, and are a way for programmers to impart all sorts of bits of knowledge about the domain that is valuable &quot;we would do X here but foo() from library Y works in such and such a way so, blah blah blah&quot;. And if you don&#x27;t like to read comments like that I&#x27;m sure your editor will fold them for you.