4 ms·
You can read (scan) code to get the general gist of it. It's more at the level of "this code looks at the pathname, then some cookies, and then either calls the
by wongarsu 2y ago
You can read (scan) code to get the general gist of it. It's more at the level of "this code looks at the pathname, then some cookies, and then either calls the signin function or returns True". That's about the same level where I read most prose. It's enough to answer the question "what does this do" (answer: "calls signin if you aren't logged in but should be") or "how complex is this" but not enough to modify the code or understand the intricacies of it.
What you are referring to is simulating the execution in my head to figure out which execution flows exist, figuring out which cases aren't covered, what the function calls actually do, what the significance of those cookies is, etc. That's similar to how I read contracts. But unless I have to write a literary analysis or somebody asks me to find all the plotholes and inconsistencies I don't read normal prose that way.
It might be interesting if there are similarities between programmers tracing execution flows, lawyers reading an unfamiliar contract, and editors finding inconsistencies in short novels.
- Wowfunhappy 2y agoBut what participants in this study were actually asked to do is: > predict what action the code would produce So "this code looks at the pathname, then some cookies, and then either calls the signin function or returns True" seems to align with that.