Logout

Criterion P - Programming

Trouble-shooting & Programming Approaches

 

Git Hub

As you get into your programming stage, one option you might consider to help keep backukp copies of your program, and to track changes is to use Git Hub (github.com).

 

Commenting Your Code

Chances are that you may not do too much commenting as you program. A. You should, and B. You will eventually have to, for Criterion D; it is the main thing that will make your program "extensible" - i.e. somone will be able to look at your program later on, understand it, and extend its functionality.

So now you are at least aware of this requirement at this point. If you choose to leave the bulk of your commenting until later - which can be a real pain, since what you did is no longer fresh in your memory, at least you will have been given the opportunity of doing so by reading this!!

 

Structures to Use

You really should be using either ArrayList or LinkedList, rather than arrays. So use LinkedList if you are able to apply either a stack or a queue, and an ArrayList for everything else.

You should also look for opportunities to use polymorphism, with both overloaded constructors and overriding, and inheritance, even if pretty simple.

Image to remind you how arrayLists, tables, and files should all interact. (The point being that the arrayList etc. is the central structure for holding and working with the data.

 

Troubleshooting Hints

- When errors are reported in the Output window, click on the top blue link to see where the error occurred.

- At the first sign of a spinning wheels situation, get up, go for a walk/get a snack etc. and then come back and look at it again.

- If/when you do start spinning your wheels in earnest, either seek help, or take a big long break.

- And as mentioned in the Responsibilities rubric, you should never go more than half an hour trying to crack a very difficult problem before seeking help from me or another student. Or just stop, and look at it another day.

- Use souts liberally to check the values of various variables at different stages of algorithms.

- Don't test with any errors (red rectangles) still showing, even if don't think they affect what you are presently testing. Fix all before running, just in case.

- If spinning wheels, (besides going for a walk) just try a different approach, even if it doesn't seem like the best one, or reasonable, and by looking at it differently, you might spot the thing you've missed. And then, if best, go back to that first approach if that makes most sense.

- Working with GUI objects, and using their methods, remember that those methods often return Objects, which you may have to change into Strings with + "".

- Some major issues can be because there are two problems happening, so fixing even a minor on that you don't think is the big deal will get you one step closer to the solution, and allow you to work on the bigger problem.