You’re encouraged to submit as frequently as you want, treat the
handin server as a remote safe storage for your homework. You can also
use the handin button to retrieve the last version of the code that you
Begin your work by getting some minimal code that can be
submitted, so you can start using the handin server as such a storage.
This usually means having a number of definitions in the code. Make
sure that these bindings have comments next to them, making it clear
that they’re a yet-unimplemented part of the homework.
The server will warn you about a penalty for incomplete coverage as
long as you don’t have enough tests — you should accept this penalty
to have your code saved, and then continue working on getting the code
to work and the tests to cover your code. Remember the scratch
option if you want to save a checkpoint that cannot be submitted
(because it cannot even be evaluated by the server).
But note that the server warns you about incomplete coverage
for a reason! When it does so, be aware of the high penalty that you
will get automatically — so don’t just accept it blindly!
If you just can’t get some part(s) of a homework done, do not give
up on getting complete coverage since that will result in a heavy
penalty on top of the missing part. If all fails, write a stub
function and a test to get the stub marked as covered, with a comment
saying that you did that to avoid the coverage penalty.
The scratch “homework” accepts anything you submit (the
server will not evaluate the code). You can use it to test that
everything is working, and as a kind of a remote file storage for your
code. Note that the handin button can be used to retrieve the file
that you submitted last, making it possible to conveniently work on the
remotely saved file.
Some style mistakes are particularly bad, and are considered
bugs. For example, “flat” non-indentation, or worse, “out-denting”
Be aware of runtime costs, and don’t spend cycles needlessly. For
example, (= (length l) 0) is equivalent to (null? l), but the
length will scan the whole list (so O(n) instead of O(1)). Also,
(append l (list x)) to add an element to the end of the list will
scan the whole list and copy it, which is much more expensive than the
O(1) cost of (cons x l).
Working with DrRacket
You should be using the “Racket” language throughout most of the
course, with a language specification line that looks like:
#lang pl ...
In the language selection dialog, click the “Show Details” and choose
the “Syntactic test suite coverage” option to see which parts of your
code are not covered by tests yet (they will be painted red), or when
you have complete coverage (when the colors will stay the same after
you run the code).
To conveniently navigate Racket code, you can use Alt with the
arrow keys to move over an expression — complete identifier, number,
string, or a parenthesized expression.
Many experienced Racket programmers never count parenthesis, they
don’t even need a paren-highlighting editor like DrRacket to do that.
The trick is to write your code in such a way that parentheses are
always balanced — never insert an open paren, bracket,
brace, or double-quote without inserting the closing token too.
DrRacket makes this easy to do: just use Alt while you’re typing
one of these open tokens, and DrRacket will insert the matching closing
one too. (On OS X, hit Escape before the open token.) If you do this
while some text is selected, the text will be surrounded by the
In addition to line comments (;), and block comments
(#|...|#), Racket has #; expression comments. When the
reader sees a #; in the input, it will read the following
expression, and discard it. This is especially convenient in
debugging, since it gives you a convenient way to disable an
DrRacket has a lot of key bindings, you can see a list of
active key bindings from the Edit menu.
In DrRacket, the open-square-bracket key ([) is actually a
magic key that guesses which paren shape should be used. In some cases
you won’t want that, and you can use control and the key to force the
square bracket shape. (But note that using the balanced paren keys is
always a better idea.)
You don’t have to use DrRacket as your editor if you don’t want
to. You can use any editor for your editing, and only switch to
DrRacket to run the code. DrRacket will prompt you to revert the file
if it was modified. In addition there is a tool called “DrSync” that
makes DrRacket automatically save the file or revert it when you leave
DrRacket or go back to it (look for it on
centralized Racket package distribution system).
Read this list! It might look like some generic “blah
blah” that you don’t really need, but it will make it much easier
for you to keep up with things.
Make sure you look at the course home page frequently for
important announcements. You can even leave a browser window open on
this page, and it will get updated by itself when there’s new content.
You can jump to various pages and sections quickly by entering
their name in the top-right “page finder” box that is included in all
pages, including this one (hit / to get there quickly).
In particular, keep an eye on your performance. You’re given
multiple pieces of information about your performance: stats charts,
and the information in the grades.txt file in the “Summary” row
on the handin server. You should plenty of grade indications to
know when you’re not doing so well: catching this early and discussing
it with us will make a “recovery” much easier.
The piazza group can have many posts, especially when a homework is due.
Don’t leave reading these messages for later — you should at least
have a quick look at what’s there so you won’t miss important
Read the Email and Piazza Group Policies handout to use the piazza group more effectively and
save time for everyone who reads the messages, making everyone’s life
easier. (Yours too: good questions get quicker answers.)
You can also consider a utility for tracking changes on a web
page. For example, Firefox has an addon called “Update Scanner” that
can alert you when there are changes to a web page, and Google Reader
can generate a feed that will show you changes in any URL if you just
enter that URL as a new subscription. There are also a number of free
services that can mail you when a page has changed.
If you use such a utility, you can also make it track homework pages to
keep up with updates to the texts.
Remember to be prepared for PLQs too: review the material if you
need to, make sure that you’re logged-in to the PLQ app on your phone
or laptop, and most importantly — read the topmost green log line when
you use the app, this line shows you what answer you’ve submitted.
If you’re not doing too well on the PLQs, please consider
suggesting PLQ questions. It does require some work to review the
material to the point where you can come up with a good question, but
it pays off in two ways: (a) if your suggested question is used, you’ll
know its answer (I frequently modify the answers, but since you’ve
looked into it, it’ll still be pretty easy), (b) just trying to come up
with good questions is a good preparation for how to solve them better
— this is something that will generally help even if your question is
Remember that your homework is being graded with comments.
Don’t just accept your grade: go over your graded homework and see what
you did wrong so you can avoid these mistakes in the future. (You
might even catch a mistake in grading...)
The graders also serve as TA’s: you can schedule a meeting with
them and get some help with the material. This is especially useful if
you’re worried about lagging behind.
Repeating the above: keep an eye on your performance, and
seek help as soon as possible if you realize that you’re beginning to