27
davide
4y

Did someone say "debug the code"?

Comments
  • 7
    👏👏👏 Breakpoints 👏👏👏

    Use them.
  • 6
    Whatever works for the bug at hand
  • 1
    Wow, that's some top notch stop the instruction debugging
  • 16
    And then it suddenly outputs "g"
  • 2
    @alexbrooklyn that's when the developer realizes they forgot to save the file
  • 2
    This is me sometimes. Particularly for scripting languages. I'll happily break out gdb for some C or C++ debugging but this is often the first thing I'll try.
  • 2
    @nitwhiz What if each time you want to know the result of intermediate results? Say, every 10k iterations. That's going to require complicated breakpoints and you might lose oversight in comparison to just setting a println there.

    I find that trying to follow breakpoints confuses me more than just seeing all the results in one second.
  • 1
    I swear I still do this when I’m stressed but it always works 😭😂
  • 0
    👍🏽👍🏽
  • 1
    I used to do this all the time before I discovered breakpoints.
  • 0
    @asgs That's IntelliJ IDEA, it saves stuff automatically
  • 0
    @bytecode true, but my comment was in response to the comment above
Add Comment