12 ms·
For me they can serve different purposes. Printing is effective, but I use it mostly when doing pre-emptive things like logging while coding. Or when I need mor
by wingerlang 10y ago
For me they can serve different purposes. Printing is effective, but I use it mostly when doing pre-emptive things like logging while coding. Or when I need more data in the log, since printing is persisted in the console. That way you can go back and inspect it.
Debugging is when you really want to take your time on each step of the execution and double check each value. It is also great if you quickly need to stop the code at a specific step without having to recompile. And while in the debugger you can also change values, execute code to some degree and so on.
So it just depends on what I want to do.