On 07/22/2014 12:12 AM, Adam Wenham wrote:
>
> I'm been reading The Pragmatic Programmer and have come across the 
> concept of 'Design by Contract' 
> (http://en.wikipedia.org/wiki/Design_by_contract), which is a concept 
> I haven't come across before.
>

It is good to learn Design By Contract (DBC).  Thinking about 
invariants, pre-conditions and post-conditions helps in making classes 
which work well and are easy to use.  You might profit from using DBC as 
a learning exercise.

I do not favor the addition of DBC conditions for most production code, 
primarily because unit tests provide most of the same value that 
conditions provide, but without bloating the code.

Wayne Conrad