CS212 Grades
Comments after Problem Set 4

Overall Thoughts

So, we were sitting around grading, and it occurred to us that you guys (I mean that in a very gender non-specific way) are really improving. This is evident in the higher mean for this problem set. We just want to say "Keep up the great work!"

General Things You Could Improve Upon

We're paying for paper, don't skimp on the output.

Use sensible variable names. Most of the time if you're using one letter for a variable name (and especially if there are a bunch of one letter variable names) you could probably find a better variable name. One thing that you might find absolutely amazing is if you use great variable names, you might not need to use any commenting at all.

Just for style purposes, if you use second and third, use first instead of head.

This is redundant code:

(if x
    (f a b c1)
    (f a b c2))

A better way would be:

(f a b (if x c1 c2))

This is an example of Blergh code:

(map (lambda (x) (f x)....)

A not so Blergh way to write this would be:

(map f....)

Code of the year:

(if beta beta #f)

So, a few of you just like using if statements.  Doesn't this code return the same thing as beta (when you're not considering side effects).

There are points in the code where you define things globally when you should have defined things locally. If it helped improve the readability of your code, then we really didn't worry about it too much. It becomes a much bigger problem when there are a lot more variable names, essentially you end up polluting the namespace. Try and make helper functions local whenever you can.

Recoding

So there's this thing called the Scheme Quick Reference, and it has a few really helpful things on it. It might be a good idea to use things already available to you like map, filter, and member. The more code you can eliminate by using these built in functions, the better.