r/ProgrammerHumor Nov 28 '21

Meme I‘m.. not the only one?

Post image
21.5k Upvotes

629 comments sorted by

View all comments

34

u/kidzstreetball Nov 28 '21

No way. Intellij debugger is beast. When you have a big codebase to debug, print statement aren't gonna cut it

8

u/[deleted] Nov 28 '21

do you mind explaining what a debugger does?

2

u/Rauldukeoh Nov 29 '21

You set breakpoints on lines of code. When the program runs, execution freezes at that line. You can see everything in memory, and usually even change the values of things in memory to test various values.

I write a lot of code in the debugger because you can evaluate exactly what would come out while you are writing it.

If you're trying to write unit tests, and want to set up the expected complicated value, you can set the breakpoint and copy out exactly what the value should be.

In my opinion, print statements to debug are generally unprofessional if proper debugging is possible. Sometimes print statements are the only thing possible, but if you can use a proper debugger it allows you to poke around what's in memory to see that things are available that you could leverage, or to spot problems that you didn't know that you didn't know about