4 ms·
Forget writing "debuggable code", whatever that is. Normally that's called "code that makes sense" or "code that a human can read", which I'll freely admit is a
by astrodust 14y ago
Forget writing "debuggable code", whatever that is. Normally that's called "code that makes sense" or "code that a human can read", which I'll freely admit is a subset of the kind of code you'll encounter in the real world. It's still what you'd expect a competent programmer to produce.
Write testable code. Each method should have a specific mandate, should specialize, and should delegate additional functions to other methods that follow the same pattern. It should be straightforward to verify that a particular method is working by exercising it according to the various branches it might take.
This is very hard to facilitate with huge methods that try to do too much, there are too many permutations.