CSE 326 -- Summer 2002 -- Programming Assignment Guidelines

Robustness: Your primary task is to create a working, robust program. This means that your program should produce correct answers on all legal input and produce comprehensible error messages on invalid input. Keep in mind that (unless otherwise mentioned) unreasonably long running time is probably an error. How should you ensure robustness? Well, at the least, try to complete without problems these steps on the Linux instructional UNIX machines (fiji, ceylon, sumatra, tahiti) before submitting your code:

This doesn't guarantee robustness, but it's a good start! Turn in your test cases; they may help us grade your work (read: give you the maximum possible amount of credit).

Coding clearly: You should always make an effort to write code that is easy for other people to read. In the real world, this is an important skill that is valued higher than cleverness or using the least number of lines/characters possible. In this class, it is important so that we can understand your program and grade it fairly. By reading through your code and comments, we should be able to figure out how your code is organized and why it works. If we can't, we reserve the right to deduct points.

Commenting: One aspect of writing clear code involves commenting your code so that it is clear what it does without reading it line by line (nothing is more boring). Comments should be used: (a) at the top of each file to tell what code it contains, (b) at the top of each function to tell what it does, (c) at the declaration point of important variables, (d) on any lines whose purpose is non-obvious.

Coding simply: Although Java and and C++ allow it, there is no benefit to writing overly complicated statements such as:

    if ((i = myfunc(counter++)) < num_iterations) {
       ...
    }
when they could easily be rewritten in a clearer manner:
    i = myfunc(counter);
    counter++;
    if (i < num_iterations) {
      ...
    }
Coding should not be a macho activity. It should be like writing English sentences that you truly want someone to understand (including yourself).

Speed: As long as your program takes a reasonable amount of time, we will neither dock points nor give bonus points on the basis of speed. In other words, all of your data structures should have the expected asymptotic time and space complexity, but the constants will not generally matter. Robustness and clarity come first! (Here's a freebie: don't optimize any piece of code until you've tested your program's speed and discovered that that code is a bottleneck.)


CSE 326 Summer 2002 Home