How to write code
In this class, you will be asked to write programs. For most programs, you will be given small example programs that you will expand and add functionality. There is a right way and a wrong way to go about this process. Read the following carefully and follow the process closely to avoid unneccesary weeping and gnashing of teeth.
1. First, verify that the sample code you are given actually works. If it does not, then immediatly get some help so that you can run it successfully.
2. Carefully study the code. Most of the code you will be given will be small and do only a limited number of things.
3. Make a guess on what each line does, and see if you can make a change to the code to test to see if you understand. See if you get the expected results when you run the changed program. If you do not, then try to make sense of the output and try another change. Always go back to the original code until you find a change that gives you predictable results.
5. Try not to make more than one change without running the program and saving an updated version. There is nothing more frustrating than having a working program that now, after 5 changes, does not work and you have no idea which change was the culprit. Keep It Simple!
6. In general, you are trying to Evolve your software. Always be in a position of strength, with a working program saved that is close to what you want, and work to make it better. It is much more fun and less frustrating to try to make a working program better than to try to get a non-working program to work!
7. Most importantly, if you do get stumped, ask a question, but see if you can predict where in your code the problem lies, and try to formulate a good question.
8. Remember, programming is teaching the computer. It can be fun (REALLY!), but it is the best way to really understand what a computer is doing and what it can and (perhaps) cannot do.