That moment when instead of debugging, you use cout to see the results...

  • 6
    wait, isnt that what we are supposed to do? lmao I do that whenever my code shows incorrect behaviour
  • 3
    Too many languages and platforms for printing not to be my default.
  • 6
    I've found that logging to console it's easier than real debugging (with breakpoints, steps and such) when you have many threads and you don't know where the problem is. It helps you to make the range smaller.
  • 4
    😂😂 i do that, cause its easier that debugging.
  • 1
    valgrind & gdb work better
  • 0
    @fbomb porque no los dos?
  • 0
    @bdhobare wait what's valgrind?
  • 1
    @garadim valgrind is a program that checks for memory leaks and errors during the execution of another program. It can be pretty useful or a total pain in the ass to use
  • 2
    try {
    throw new Exception ()
    } catch (Exception e) {
    print ( e.stacktrace() )

    I find this an awesome trick for debugging as well. And yes, I know the code isn't technically correct in any language, but you get the point.
  • 0
    @ocab19 thx! I'm sure I'll check it out 😊
Add Comment