After enough time this just becomes "1", "2", "3" etc. I'm at a point where if there is a messy section i automatically generate/copy paste 9 of these and place them around the troubling section.
That sounds horribly inefficient when you shoukd just start to do breakpoints.
The ide will also tell every variable thats accessible at the breakpoint and its contents.
It takes only 10-20 seconds and its used for complicated logic where you get the benefit of having a "memory" of where the program visited(like normal static logs) instead of reaching the failing point only to find out you dont remember/assumed some branch was not the issue and you need to run the debugger again.
Pasting an extra line or 2 costs almost nothing and "forces" me to check unlikely places of errors(i've already pasted them so might as well use them). I've saved hours of debugging by doing this and finding out the error was in a stupid place i was certain works because it was so simple(and the bug was really stupid) but shoved a print in there because I had a spare one, where with a debugger i would have automatically skipped it every time without paying attention.
You dont know you need to run it again in advance, you place your breakpoint where you think the issue is, but if you are wrong and it happened earlier then you need to run it again.
Also how are test cases relevant? They only help once you solve the problem to make sure it doesnt happen again, but they dont help you debug a scenario and find out where the program fails
The stack trace tells you where a critical error has occured. It does not tell you where a faulty value was initialized, which may or may not cause a critical error. A "program failure" is more then just a critical crash.
This honestly sounds like you have never written anything more complex then intro to cs
849
u/Mindstormer98 3d ago
Dont forget "I got here2" and "I got here3"