3 ms·
Might be worth mentioning that you do not have to resort to printf debugging in Rust or python; both languages have good ide debugger support. I use python and
by drewm1980 6y ago
Might be worth mentioning that you do not have to resort to printf debugging in Rust or python; both languages have good ide debugger support. I use python and rust together professionally.
- brundolf 6y agoFor something quick, it's often more ergonomic to just print a thing out than step through. Also, most debuggers also won't be very helpful for embedded expressions; you have to break it out into a local variable.
- 0x008 6y agoYou can set a breakpoint and also watch expressions, so there is not more work involved than hitting 2 keyboard shortcuts usually.
- deleted 6y ago[deleted]
- damnyou 6y agoprintf debugging (i.e. listing code execution traces) is better than a breakpoint-based debugger in most situations, in my opinion.
- breuleux 6y agoFor what it's worth, I made a Python package that lets you combine both approaches: https://github.com/breuleux/breakword https://github.com/breuleux/breakword. You run your program once to print out what's going on, but it also displays a unique word next to each line and on a second run you can set a breakpoint at any of these words to investigate deeper. It's pretty handy when you spot an issue at the hundredth invocation of some function deep in the program's execution.
- a_t48 6y agoThat's really awesome.
- colejohnson66 6y agoWould this make sense in a logging situation?
- int_19h 6y agoThey do, but sometimes you have to debug in an environment where an IDE is not available, and even remote attach can be problematic sometimes. And then, sometimes, you need to debug the debugger...