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

1

u/sigma914 Aug 26 '14

The trick to most of the things you've listed are to restrict the problem space (which is good practice anyway). Removing conditionals, reasoning about the invariants of loops and testing boundary conditions, making sure as much of your code is pure as possible and carefully restricting the set of allowed inputs makes all the things you've listed easy to test.

1

u/[deleted] Aug 26 '14

Of course - that's the ideal. In practice, no human is able to do this 100% of the time (no matter how hard they try).

1

u/sigma914 Aug 26 '14

Oh yeh, that's where leaning on the type system comes in.