For example, we read data from a file. But wait - the file has to be open first! So we read data from an open file, and we write data to an open file, right? Well, but to write to a file, we have to have opened it in write mode.
See what I mean? There are multiple layers of rough approximation that humans effortlessly sort though in order to gloss over unimportant detail during the early stages of a solution, then to retrieve it only when it becomes necessary.
This can sometimes have bad effects - garden-path solutions where we find that our solution is no solution because of some irritating detail we forgot until just now. I wonder if one characteristic of genius is to retrieve those details more quickly than others. At any rate, even a genius would quickly become bogged down in extraneous detail without this zooming-in mechanism.
I think of this as "informal logic". In formal logic, if I state "P", then P holds. Period. In informal logic, I may state "P", then later say, "Well, except for in this case." The same is true of open files - it's true that I can write to a file, but there are caveats. The question is, at what stage do those caveats get retrieved in order to contribute to a solution?
I suspect the answer lies in the syntactic expression mechanism, at least in part. When I sit down to write real code to write something to a file, that's when I remember that I have to signal the write mode during the file-open command, and that's because I have that knowledge connected to the actual syntax (along with some background knowledge that I have about how file I/O works).
No comments:
Post a Comment