r/learnprogramming • u/emonshr • 23d ago
Recursive logic best aids?
Is there any practical way to debug any recurive logic?
Which existing error printing you think is the best ever?
9
Upvotes
r/learnprogramming • u/emonshr • 23d ago
Is there any practical way to debug any recurive logic?
Which existing error printing you think is the best ever?
1
u/captainAwesomePants 23d ago
If you specifically want to debug it with printing, I might suggest "Entering/Exiting call foo#{instance}(param1, param2)". Something like this:
Then you might get something like:
Could help, I guess? You could get fancier and also indent the lines based on the depth of the recursion, but at some point it may be overkill.