Feb-08-2021, 02:52 PM
"looking at it" is not a useful debugging technique. You wrote the code in a way you thought was correct. When you "look at it" you are going to see it as correct. Debugging is really just testing with the purpose of fixing your code. Debugging is an active process. Instead of "looking" you should be "testing". If you have a debugger, single step through the code and verify it works as it should. If you don't have a debugger, or don't like using the debugger, add print statements to you code or extract snippets and test them in little test programs.