Successfully Completing Assignments

Version 1.03

Overview

Each assignment will require you to complete one or more programming tasks. The sooner you develop good personal programming practices the more successful you will be. Below are several suggestions from your instructor, if you have additional ideas that should be included, please suggest them so they can be added to the list.

Read the assignment several times

You will not remember everything you need to do in one reading, and relying on the lab instructors and/or your friends is sure to be less than desirable. I suggest you plan to (re-)read the assignment before each work episode. Also, the following times would be a good idea:

Read the assignment carefully

If there are any unclear parts it means you do not understand part of the problem. You need to understand the problem before you have any chance of solving it. If re-reading the assignment does not clear it up, you should find some help. Remember the resources available to you as part of this class (check you syllabus if you can't remember them all).

Create good test cases

You are responsibe for your program working, therefore you will need to test it. Testing can be hard because bugs can sometimes be very "tricky" and only happen only occasionally. Below are some suggestions to help you create good test cases.

Sleep on it

Do not attempt to complete the assignment in one "sitting". Plan to work in several blocks of time. The length of each block should be measured in minutes, not hours. It may be possible to line up several blocks back-to-back, if you take a break between sessions, but ideally you should sleep or at least do something unrelated between sessions. Returning to your work later allows you a much better perspective on your code.

Work up to it

Do not attempt to "get it right" the first time. Work up to the answer after several attempts. First get a small part of the problem working (for example, reading the input correctly). Then add another part, then another, etc. This way you can make sure part of your program is working and you know where any new bugs will be in your program. For example, if your program was reading the input right but now crashes, after you added a new function, chances are its the new code that caused the crash and you can start looking there.

Explain it

When you get stuck, explain what you are trying to do to someone else, such as a classmate or lab mentor. Usually you will figure out what went wrong while you are explaining it to the other person. Don't worry, this is normal and happens to "real" programmers all the time.

Work near others

If you want to take advantage of the "Explain it" rule, you will need to work near others. That doesn't mean you should all set around the same keyboard and monitor. It means that when you have a question about syntax, or need to be reminded about something, or need to explain it, or you can't figure out an error message, that someone will be there to help you. Then you can return the favor later.

Explain it again

When have completed the assignment, explain how you did it to someone else, such as a classmate or lab mentor. Try to be as precise and "technical" as you can about what you did. The process of explaining yourself to someone else has been shown to be one of the most effective ways of retaining new knowledge.