Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to avoid debugger?

I don't like debugging in a debugger, because I think it is often below the abstraction layer of the programming language and it is often not reproducible. I favor using unit tests when possible and I think they are a good way, but it is not always that easy to implement them. Do you know about any other alternative approaches to avoid the use of a debugger?

like image 492
Gabriel Ščerbák Avatar asked Feb 25 '26 00:02

Gabriel Ščerbák


2 Answers

A debugger is a tool saying I want to avoid a debugger is like a carpenter saying I want to avoid a hammer. You are better of asking the question When should I avoid using the debugger?

Times when you should avoid using the debugger,

  • When you have no idea what the code is doing, understand first then try debugging otherwise your wasting your time
  • The issue is timing related (raceconditions, problems with IPC or threads), if it is a timing condition and you start single stepping, then you might not reproduce your problem.

I am sure there are other times when using a debugger is a bad idea, but my point is your question is wrong. Don't ask how do I not use the debugger but ask when should I/shouldn't I use the debugger.

my 2cents

like image 168
hhafez Avatar answered Feb 28 '26 02:02

hhafez


Think! :) - Seriously, though - before debuggers were commonly available, most people would troubleshoot their code by writing lots of state information to their output device. It still works.

like image 38
500 - Internal Server Error Avatar answered Feb 28 '26 02:02

500 - Internal Server Error



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!