2 ms·
I don't find myself reading code for the sake of reading it. I'm usually trying to answer some questions, such as "how is this structured?" or "what might be ca
by yuliyp 6y ago
I don't find myself reading code for the sake of reading it. I'm usually trying to answer some questions, such as "how is this structured?" or "what might be causing buggy behavior X" or "how expensive is this" etc. That informs the things I pay attention to and the things I ignore.
The way I read code is meant to optimize for question-answering and understanding (aka future question-answering). To that end, I've learned many heuristics, such as "pay attention to method signatures, look at what the loops iterate over, understand the call graph, skip over the error handling bits unless needed, etc. I don't view these as tools for helping me read, but tools for helping me gain understanding of code quickly and without wasting brain space on probably less relevant bits.
- Cthulhu_ 6y agoSame, but I just realized that doing code reviews is reading code; I haven't done that in a few years now, but it does make you think about how you yourself write code, so that was a valuable lesson.