Code composition is error-prone because it places severe demands on the programmer's cognitive processes. The programmer could benefit from the machine's help at this stage, but conventional programming environments are essentially passive then. The usual assumption is that the programmer does debugging after entering a whole routine, although by this time his/her memory of some details may have decayed. We propose that coding efficiency would be improved if, as soon as a statement is typed, it is executed, and the new program state is displayed. The programmer can see whether the statement has the intended effects, and correct it while the thinking for it is still fresh. We have implemented and informally tested a prototype of this "ahead-of-time debugging" feature. We found that users fix more bugs during code entry and produce code faster and with fewer errors, compared with a conventional environment and report that using the latter is like "programming in the dark".
展开▼