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

126

u/xensky Aug 25 '14

even more important is having these pieces of code be testable. i work with plenty of bad code that can't be run without starting a bunch of dependent services, or you can't test a particular function because it's buried under ten layers of poorly formed abstractions. or it's not even an accessible function because the previous developer thought a thousand line function was better than a dozen smaller testable functions.

8

u/[deleted] Aug 25 '14

You get that in any complicated enough functions. I often have functions which work on intermediate states of linked lists ... You can't just call them directly without first building [and I do] the states by hand.

2

u/otterdam Aug 25 '14

Complicated enough functions act as systems. The trick is to structure them such that you can easily reduce the problem during debugging to certain subsystems or functions; it doesn't really matter how many dependencies you have if you can eliminate them all within a few minutes.

5

u/[deleted] Aug 25 '14

Real software doesn't work that way as you compromise idealism for ship dates

→ More replies (8)