4 ms·
You use logging for production, but if you just want to see what a value is while when you run your program in the IDE and might not for a logger imported, prin
by akvadrako 8y ago
You use logging for production, but if you just want to see what a value is while when you run your program in the IDE and might not for a logger imported, print is handy.
- rpeden 8y agoIf you're running from an IDE and want to inspect values, why not just set a breakpoint?
- tormeh 8y agoDoesn't work with multithreaded applications and works poorly with non-deterministic behavior, so sometimes you just have to print lots of info and see if anything interesting pops up. It also requires knowledge about tooling for the language you're working on right now, which as a polyglot you might not care to learn.
- all2 8y agoComing from python I like to set a breakpoint, and dive in with pdb. It's super easy to navigate through the stack frame and poke around to see what all the variables are. I get more out of inspecting state from inside of pdb than I do out of print statements. On the other hand, I tend to use only print statements when I'm roughing in a program in an iPython Notebook. This gives a sort of visual documentation when navigating a library that I'm new to, and allows me to glance back at a verbose description of otherwise opaque data structures.
- LoSboccacc 8y agoNah there's debugging for that