In addition to following the design recipe, we would like you to observe
basic style guidelines for your programs:
-
No line should span more than 80 characters. See bottom right of
DrScheme. Break lines at those points suggested by the books (HtDP,
HtDC).
-
No function should span more than five to eight lines for now.
If it does, reconsider your interpretation of the "one task,
one function" guideline.
-
Use names that make sense with respect to the problem.
-
Start the file with globally useful data definitions and constant
definitions. Then arrange to place the most important function near the
top of the file and the less important ones near the bottom. NOTE: You
don't have to develop the functions in this order, you just have to
arrange the program this way.
-
Separate distinct sections of your program with dashed lines that are
exactly 80 columns wide.
-
BSL and ISl programs use the parentheses style displayed in the books:
| good | bad |
|---|
(define (f l)
(cond
[(empty? l) 0]
[else (add1 (f (rest l)))]))
|
(define (f l)
(cond
[(empty? l) 0]
[else (add1 (f (rest l)))]
)
)
|
These dangling parentheses for the code in the right column are considered
extremely bad style. You will lose all
style points for using it even once.
Not observing this very basic guidelines leads to unreadable code and to
loss of points. You're too old for both.