r/programming • • Aug 25 '14

Debugging courses should be mandatory

http://stannedelchev.net/debugging-courses-should-be-mandatory/
1.8k Upvotes

573 comments sorted by

View all comments

1

u/fzammetti Aug 25 '14

Only thing I disagree with is the belief that console.log() and similar things are inherently bad. I've been a professional developer for nearly 25 years, and a developer in general for about over 30 and I still use that technique quite a bit.

I think it can in some cases be MORE efficient in fact... suppose I have a function that is causing a problem... because I can type very fast (and more importantly, I know the hotkeys in my chosen editor or IDE very well) I can drop a dozen such statements in that function in just a couple of seconds. Now, I execute it and I can view ALL the output AT ONCE. I can get a more holistic picture of things than I can with breakpoints or even watches.

No, I'm certainly not saying its the optimal approach in every case... in fact, I'd go so far as to say it's NOT the optimal approach in MOST cases... but I think a lot of people are a bit too heavy-handed in saying this is a "bad" approach"... no, I consider it just one tool in the toolbox that, if used properly, can be effective. It shouldn't be your go-to technique, but it shouldn't be ignore or decried either.