This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 135 Style and Submission Guide 1 Assignment Style Guidelines The code you submit for assignments, as with all code you write, can be made more readable and useful by paying attention to style. This includes the placement of comments, whitespace, indentation, and choice of variable and function names. None of these things affect the execution of a program, but they affect its readability and extensibility. There isn’t a single strict set of rules that you must follow; just as in writing English prose, the goal is communication, and you need to think of the needs of the reader. This is especially important when the reader is assigning you a mark. 1.1 General Guidelines The examples in the presentation slides and handouts are often condensed to fit them into a few lines; you should not imitate their style for assignments, because you don’t have the same space restrictions. The examples in the textbook are more appropriate, particularly those illustrating variations on the design recipe, such as Figure 3 in Section 2.5, Figure 11 in Section 6.5, and Figure 17 in Section 17.2. At the very least, a function should come with contract, purpose, examples, definition, and tests. After you have learned about them, and where it is appropriate, you should add data definitions. See the section below titled “The Design Recipe” for further tips. Never include Comment Boxes or images in your submissions, as they will be rendered unmarkable. Never copy-and-paste from the Interactions window into the Definitions window, or your assignment may become unmarkable. You should prepare one file for each question in an assign- ment, containing all code and doc- umentation. The filename to use for each question will be specified in the assignment. All the files for an assignment should be in a folder/directory whose name is the assignment abbreviation: the letter a followed by the two-digit assignment number (use a leading for numbers less than 10). For example, the files for Assignment 8 should be in the folder/directory a08 . If the question asks you to write more than one function, the file should contain them in the order specified by the assignment. Helper functions should be put with the assignment function they are helping, but whether they are placed before or after is a judgement you will have to make depending on the situation. In working with several functions in one file, you will find it useful to use the Comment Out With Semicolons and Uncomment items in DrRacket’s Racket menu to temporarily block out successful tests for helper functions. Note: never include Comment Boxes or images in your submissions, as they will be rendered unmarkable. Never copy-and-paste from the Interactions window into the Definitions window, or your assignment may become unmarkable....
View Full Document
- Fall '07
- ASCII, DrRacket, design recipe, Posn Posn → Num