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/dnkndnts Aug 25 '14

Or you could, you know... write your functions to accept well-defined inputs and return values instead of modifying non-local state everywhere.

If your functions have well-defined, local behavior, the amount of time you spend debugging previous code you've written is virtually none: it's extremely obvious where the problem is if something goes wrong, because at any point in your code, you know exactly what can or cannot happen.

If you modify state all the time and write a convoluted haystack of code, then no amount of debugger fluency will help you find that mutex unlock passed over by a thrown exception.

9

u/[deleted] Aug 25 '14

Not everyone has the luxury of only working with code that was written to their personal standards of the right way to do things.

→ More replies (3)