Formatting of some sections was changed along with other minor corrections during this revision. Global Variables Indentation Data Structures Magic Constants Miscellaneous 1. In the real world programs need to be read by the original authors while they are being debugged, by the people the authors go to for help, and by future programmers who have to maintain them. A program that is written so that it runs fast, but has no comments, will end up taking more time overall, because maintenance is so difficult. In a computer science class, programs are read not only by the student debugging the program but by the consultants the student turns to as well as the instructor and grader.
Style is as important in writing a computer program as it is in writing a literary essay.
Up to half of your grade on MACS261 homework will be based on program style. You should read through this style guide the first week of class. You probably will not understand all of it, but that way you will get the idea of things we will be looking for while grading. Then you should consult this guide before you turn in your homework, to make sure that your program fits these guidelines. Prolog block comments go at the start of every program, file and function, explaining what it is supposed to do as well as explaining any arguments that are expected.