Hi there ! I have a question about debugging. Is it fine to debug every source that you write, even if you didn't run it? I'm used to debug first, is it ok ?
I ask because I practice for a contest, the Olimpyad of computer slkill's, in my country. So, in a contest is it fine to debug or I waste time? :)
Debugging, as its name implies, is done to remove bugs. If you haven't found any bugs, you shouldn't be debugging.
To find bugs, you should test. i can't advice you on how to perform tests because it depends too much on the application, but normally you want to try with sensible input (input that would be encountered normally), nonsensical input, and edge and corner cases (when one input has an extreme value, and when all inputs have extreme values). Additionally, there are tests specific to a problem. For example, you would want to make sure that a division doesn't break when the divisor is zero.
Usually, I debug first because I want to see how the source works, step by step ... Because, when I start to do a problem I think about it on paper, make tests and debug it in my mind.
For me, to debug is to run step by step and see how it works. I think I should start to consider debugging a search for bugs, not a 'story' of the code. :)