| > Of course you need context to understand code. Comments decrease the amount of code you must personally read and understand, and define invariants that can't be expressed purely through the code. > At which point there are enough comments that you need context to figure out which parts of them you care about, reading them becomes a chore, and they essentially become noise. I've never seen this outside of contrived examples from lazy developers that think they're too smart to need to comment their code. > If the model is simple and the code is clear, learning the context becomes easy, and it fits into your head. In other words, you must trace the entire system to understand it and then fit it into your head. This is not advantageous to maintainers. |
No, just the part you care about. You do need a high level mental model of the system. I've never seen a system where this is not the case, regardless of the number of comments. Even literate programming -- or at least, the examples of it that I've seen -- suffered from this. (Amusingly, I found literate programming examples were often easier to understand by mostly ignoring the prose and looking at the code.)