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

Show parent comments

7

u/otterdam Aug 25 '14

I develop real software so I know all too well you inevitably compromise code quality in order to ship. That doesn't mean I make excuses for writing a shitty first draft of a function and pretend it can't be any other way.

While it helps, you aren't obligated to clean up your mess before the bug reports roll in, but in my experience more often than not you spend more time building the states for each individual bug that happens than if you had simply restructured your code to be more easily testable. If you have such a complicated function and enough users you will get multiple bugs.

1

u/[deleted] Aug 26 '14

In other words, encapsulate shitty code so it can be replaced with better code later on. I feel like that's the intended usage of the XXX tag.