Wednesday, 28 January 2015

The wonders of retracing your steps!

As I'm procrastinating on finishing up A1 right now, I've realized something very, very useful we haven't really touched upon in class. (Or, if we had, I was too busy nose in computer trying to fix A1 since I didn't know this, so.)

As we move on to more and more complicated assignments, we're forced to step back and look at the big picture. Suddenly, we have to think "are the parameters I'm sending to this function really correct? The function may be okay, but if the input is bad, the whole thing can appear wrong."

This is why tracing is important. I'm sure everyone has a word they use and definition they use to describe this, but in designing and test A1, I personally put in print statements at the end of every function. In doing this, I can follow the various lists, numbers, and strings being sent to and from my game state at all times. In doing that, I can follow where everything was going, and when I do spot a mistake, it takes only a few minutes to spot and fix.

Only issue?

I figured this out after 2 weeks of old school debugging.

No comments:

Post a Comment