News for hackers. Stuff that matters.
Re:The unreasonable effectiveness of print debugging by wmichelin on Saturday April 24, 2021 @01:37PM (#26926729)
Python easily has the best debugger I've ever seen in a language.

``` import pdb; pdb.set_trace() ```

that's literally all you have to do at any point in your code. Run your code in the foreground of a terminal, and boom you have a debugger exactly where you want it.

Re:The unreasonable effectiveness of print debugging by gmfawcett on Saturday April 24, 2021 @02:49PM (#26927340)
In recent Python, it's even easier -- just put `breakpoint()` in your code.
Re:The unreasonable effectiveness of print debugging by anarazel on Saturday April 24, 2021 @06:03PM (#26928543)
Fwiw, it's not too hard to approximate that in c/c++. Print out the pid (I often print out "gdb -p %d") and then sleep (and perhaps send SIGSTOP to other processes in more complicated scenarios).
Re:The unreasonable effectiveness of print debugging by twobitshifter on Saturday April 24, 2021 @10:55PM (#26930003)
Pry with Ruby allows you to drop in to a repl anywhere with binding.pry

You can edit the state and keep running after altering the program.

But usually I just end up printing a few things from the repl and figuring out what is fouled up.