17

College: This is the debugging mode This is a breakpoint. Here you can see the variable values.

Work: print "asfadadadda" and variables and delete lines until it throws a different exception

Comments
  • 6
    Not at all.

    Sure, occasionally I do sprinkle debug.write statements but only where either there are so many methods and I have no clue where to start or when there are conditions in play that hides the error while stopping for break points.

    I usually start out trying to debug with breakpoints if not the normal error log already provides the answer.

    But an example where I did use debug.write was when debugging our scripting engine and a single run through could mean calling the same method a hundred times ;)

    Stepping through just took to much time.
  • 1
    I work in node and typescript. I use console.log driven development. As I build, I look for exceptions and inspect the data. I haven’t needed debug for my own code in a long time. I can come back to it many moons later and see how it works.

    Now other people’s code… I debug the heck out of that. It reminds me of when people build a PC and stuff the rats nest of loose cables into the open space of the case and close it to hide the mess.
  • 0
    Had no other option at that job which I had to maintain alone a shitty project that could not have a debugger because the tech and business partners whom the company depended on sucked.

    It was either that or the 4 freaking LEDs on the board, but you don't want to get into that miserable point in your life.
  • 0
    Use a debugger, usually much better and faster than print debugging if your language has decent typing. Otherwise, good luck.
  • 0
    @irene for js/ts I tent to use debug.log a bit more, mostly because some things just don’t debug as gracefully.

    But for backend, debugging is generally better.

    But as always, use the tools you have that works the best in each situation.
  • 1
    @RememberMe if I could I would
  • 0
    Actually work: the app wont work in debug mode so you have to use printf for debugging.
  • 0
    @YADU That is what I was talking about
Add Comment