- locate the issue
- understand the entirety of the segment to avoid other pitfalls and understand the issues intended purpose
- minimize changes to avoid creating bigger problems. Rewrite entire segment if necessary (which is why encapsulation is so important)
I dont see how this is reading it like text or what that means to be honest. When I read poetry I read every single line. When I read a novel, I rarely I will glance over dialogue or entire segments because I understand the inteded gist. When I read the news I look for where the fluff ends and read the paragraph to understand what the hell is going on.
If anything I believe we should read more news to be better debuggers. Locate the problem quickly and understand in its entirety. A personal opinion of course
But, the idea is to try and understand why was the code written like that, what is the model the original programmer had in mind, and whether there could be more of the same errors in other places. It's the way you can see a db table and immediately know where will there be issues in the db design.
When you say it, it sounds complicated, nuanced and elegant. But, from personal experience, it simply relates to mental rules like "make sure your fix doesnt screw up more things" and "if you think a programmer is doing something weird, its probably weird" and "if everything looks fine here, look upstream"
For something like database design, usually there is a restriction of the orm that causes fluff or the programmer is trying to minimize memory usage by reusing variables or something else that can cause utter chaos. Im all for "thinking like the writer", but I feel like that doesnt present actionable steps only to approach it with sympathy. Id argue, get a mental model of minimal necessary steps and see how the other program fits into it or expands upon it.
As such, I've been a proponent of reading code like text, instead of the usual maintenance method of locating the line with the bug, making the most minimal change and leaving everything else as-is. I believe the more I read the actual program, the better I can understand why was there a bug, get some insight into the original programmer's thinking, and maybe get some more idea on how to better fix the problem.