codified knowledge

seth writes software. seth tries to be better software writer. seth writes blog.

We are constantly interfacing with other people’s code - code that might not live up to our high standards - and dealing with inputs that may or may n ot be valid. So we are taught to code defensively. If there’s any doubt, we validate all information we’re given. We use assertions to detect bad data. We check for consistency, put constraints on database columns, and generally feel pretty good about ourselves.

But Pragmatic Programmers take this a step further. They don’t trust themselves, either. Knowing that no one writes perfect code, including themselves, Pragmatic Programmers code in defense against their own mistakes. We describe the fire defensive measure in “Design by Contract:” clients and suppliers must agree on rights and responsibilities.

The Pragmatic Programmer, From Journeyman to Master (Andrew Hunt, David Thomas)