Thursday April 07, 2011

Lucid Code

As a followup to my post about the Objective-C Kiwi testing framework, I found this nice post by Avdi Grimm about leveraging the expressiveness of that syntax style when writing your tests:

Another fringe benefit of [test driven design] which has fallen somewhat by the wayside, in my opinion, is the notion that the tests can double as the documentation–documentation which, by its nature, can never fall out of sync with the source code.

Our code and tests should be lucid. It is the blueprint. Write with the intention to read. Or as Martin Fowler puts it:

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.