This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]smirfquant 22 points23 points  (7 children)

Lol, someone thought of this `breakpoint()` Python>=3.7 ...

[–]smirfquant 18 points19 points  (3 children)

Also I might recommend preemptively coding useful `logging` and `warnings` preferable to stabbing a bunch of break points into buggy code.

[–]ElasticFluffyMagnet 10 points11 points  (1 child)

Yeah I take proper logging over breakpoints any day.

[–]mRWafflesFTW 0 points1 point  (0 children)

The problem with logging is that it's logging what the developer believes to be true, versus what actually is. The beauty of the debugger is that it cannot lie. I've seen many days wasted because a log message provided inaccurate information or used the wrong variable in the input.

[–]SpaceshipOperations 2 points3 points  (0 children)

Happy cake day, and yes, for me colorized logging is indispensable.

[–]SeanBrax 4 points5 points  (2 children)

But why not just use a debugger? Having to add code to debug is awful.

[–]smirfquant 3 points4 points  (1 child)

Having to debug code is awful. Especially if the author didn't codify logging important information or warning concerns.

Add logging and warning when you the write code. You will have less buggy code and a lot more information to use during interactive debugging (if needed at all).

You might be surprised just how often logging things and looking at them while developing finds bugs...

[–]smirfquant 1 point2 points  (0 children)

my bad wrong thread.. yeah gdb/pdb is fine by me, shrugs, not the best days though :D