AlterAB's blog

By AlterAB, history, 15 months ago, In English

Can you guys recommend me a tool or a way which I can debug nested for loops in a code properly, I find it difficult to debug them because a lot of debug statements get printed, and I get a bit confused and I am not able to debug. In general, I am very weak in debugging my code and I want to know how can I improve in it.

  • Vote: I like it
  • +11
  • Vote: I do not like it

| Write comment?
»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I like to do things one step at a time, for example, i first print any vectors involved at each iteration, then check what's going wrong, slowly checking involved data structures works for me most of the time.

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

I don't know, I always print every variable. EVERY. Which might be the reason I havn't reach Master yet.

It would be great if you insert one motr space before the debug print line for each layer of loop and recursion etc, it would be much easier to find the program structure.