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 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).
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 “plait” language throughout most of the
course, with a language specification line that looks like:
#lang plait
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. 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).