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
submitted.
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.
You should be using the “Module” 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
delimiters.
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
expression.
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
PLaneT, the
centralized Racket package distribution system).
Keeping Up
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 leave a browser open on this page,
and it will get updates by itself.
You can jump to various pages and sections quickly by entering
their name in the top-right “page finder” box.
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
information.
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.
More Help
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.