Programming is Writing: Why Student Programs must be Carefully Read

Teaching a student to write computer programs well is much like teaching a student to write English prose well. That is, although a program must be correct in every last detail, achieving correctness is only half of the task. The other half consists of quality factors such as clarity, organization, conciseness, maintainability, etc. Although these factors cannot be automatically measured, they have a large economic impact, because a major cost of software development is the time spent by other people reading programs to validate, maintain, and enhance them. To teach these quality factors, student programs must be read by a skilled programmer. Furthermore, grades for programs must be partly based on these quality factors. Completely automatic testing and grading of student programs by machine not only ignores these quality factors, it also fosters the attitude that such factors are unimportant. When programs are automatically tested and not read, students come to believe that functional correctness is all that matters. They tend to write programs by making changes in an initial attempt at a program until it “works.” The result is students who cannot write programs well. From this analysis and our experience, we conclude that enough human resources, such as teaching assistants, have to be made available for programming courses to ensure that there is adequate time for careful reading of student programs.