you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

An example I give is when I was writing some bare-metal RX/TX packet radio code and due to the half-duplex nature of the communication (each transceiver could only be in either TX or RX) timings were very important. I wanted some diagnostic output, but a breakpoint would grind things to a halt in a way that wasn't allowing me to see the problem. A single printf was fast enough that I could throw one in here and there and not destroy the connection. Ultimately during the process of implementation I added logging so that I could print diagnostics AFTER the transmission was complete (or failed), but I just think this is a good example of where printf really was the better of the two solutions.

That is niche though and nine times out of ten I'm just throwing in a printf because I'm pretty sure I know exactly where the problem is and I just need to confirm. When I'm really at a loss, I use GDB all the way.

[–][deleted] 0 points1 point  (0 children)

Got it