CS 5010 F '09
 
Pair Programming
The Recipes
The Style
Subversion
Assignments
Set 1
Set 2
Set 3
Set 4
Set 5
Set 6
Set 7
Set 8
Set 9
Set 10
Set 11
Set 12

The Styles

logo
In addition to following the design recipe, we would like you to observe basic style guidelines for your programs:
  1. No line should span more than 80 characters. See bottom right of DrScheme. Break lines at those points suggested by the books (HtDP, HtDC).
  2. 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.
  3. Use names that make sense with respect to the problem.
  4. 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.
  5. Separate distinct sections of your program with dashed lines that are exactly 80 columns wide.
  6. BSL and ISl programs use the parentheses style displayed in the books:

    goodbad
    
    (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.

last updated on Wed Dec 2 17:58:10 EST 2009generated with PLT Scheme