4 ms·
You have heard of debuggers, right? Just because every IDE includes one doesn't mean they don't exist outside of IDEs. (For that matter, when I used to develo
by colomon 15y ago
You have heard of debuggers, right? Just because every IDE includes one doesn't mean they don't exist outside of IDEs. (For that matter, when I used to develop on Windows, I pulled up Microsoft IDE for debugging only.)
Honestly, though, probably 80-90% of the time I do prefer printfs for debugging. A debugger is great if you can easily get to the problem area. If you're just trying to figure out what is going wrong with complex code, dumping a lot of information in a format you can easily look over with a text editor is generally a superior approach.
- Symmetry 15y agoI've always found that print statements are usually best for code I wrote myself, whereas a debugger is most useful for other people's code.
- burgerbrain 15y agoA combination of the two can be quite nice ;)
- gte910h 15y agoI've found those times people can't figure out why code doesn't work at all is almost always related to over reliance and trust of what the debugger is claiming to be truth. It can be faster, but output (printf or more complicated state outputs) seems to always be more reliable.