The What But Not The Why

Today's programming languages can express the what, but not the why. DesignByContract may be be one step in the why-direction. --FalkBruegmann

(TheSourceCodeIsTheDesign being the presumed "what" direction)

:DesignByContract only allows further proofs as to whether the 'what' is being accomplished. Fundamentally, to meaningfully understand 'why' (as in passing it to the compiler) requires both a formalization of 'goals' for a specification, and a formalized means of proving that some specification will accomplish that given goal. You need an end-product in mind (a value, a behavior, etc.), and this end-product needs provable properties (i.e. 'assuming communications failures are below 10^-6 block error rate, and bounded non-determinism for communications, this protocol will allow VoIP' -- all coded into some language the prover can understand). ConstraintBasedProgramming? is the closest thing available.

The same can be said of a blueprint for a house. Why are the main support beams under my house 4x4's and not, say, 4x6's? Why are the eaves as long as they are? Why does the hot water pipe run under the hallway and make a right turn to get to the bathroom instead of heading directly there?

The blueprint (source code) tells the builders (compiler) what they need to know to make the house (executable program). How does the architect (programmer), then, record the reasons for her various design decisions? I really don't know, but I suspect there are a variety of ways -- some of it actually does appear as comments in the blueprint, some of it appears in the contract (specification?), some of it comes from architecture's BestPractices, but I bet a lot of it, like the length of the eaves, does not get recorded anywhere at all.

Might compare this to TheSourceCodeAndTheArchitecture.

-- BillTrost

Ways to document design decisions? See TechnicalMemo

For a page similar to this one, see CommentTheWhy

Actually, the reason for the length of the eaves and the size of the supports and so on come from things like building codes and the physical engineering work that went into the architectural standards of the day. The more interesting questions in home architecture are why you have to go through the kitchen to get to the laundry room, why the bathroom is at the end of the hall, or why you have to crawl through the kid's closet on the second floor to access the water heater. These result from a creative process of trading organization and convenience for space and money.



EditText of this page (last edited July 14, 2010) or FindPage with title or text search