Thread: Code issues
View Single Post
Old 19 March 2013, 16:51   #25
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
My suggestions for approaches to fixing anything that doesn't work right:

Narrow down your search for the error as far as possible by first thinking logically about where the type of error seen can and cannot occur.

Test pieces of code in isolation using the debugger and make sure that what you have assumed is working code really is working code.

Sleep on it. This might sound trite but I have fixed many annoying little issues in my code by taking myself away from something that doesn't work, stopping thinking about it, getting a good night's sleep and looking again in the morning with a fresh pair of eyes.

Once all of the above has been done exhaustively and something still doesn't work, only then ask for help.

Don't let asking for the answers become a substitute for logical thinking and testing. It'll help in the short term (you'll fix the problems quicker) but will hinder in the long term as you won't have gained any of the really worthwhile experience of finding and fixing a problem yourself which is where all your real learning is done.

I hope the above is taken in the spirit that it was written with: as helpful advice that I really believe is true. Good luck with fixing your code!
pmc is offline  
 
Page generated in 0.04901 seconds with 11 queries