Hacker News new | ask | show | jobs
by danieltillett 3960 days ago
The bugs that catch me out are those where a change was made somewhere else that invalidated the assumptions made by the function. These sort of bugs can’t be picked up by static analysis or valgrind, and if they are rare are really hard to trace.
1 comments

Which is why you should put those assumptions in contracts. Preconditions, postconditions and invariants were made exactly for that purpose.

I used to think these were a distraction from actual programming until I realized how much debugging time they save.