Skip to content

Monthly Archives: February 2009

The Fairy Tale Beauty of Unit Testing

To demonstrate the incredible beauty of unit testing, I have composed this short script. Imagine how much better your favorite fairy-tales would be if they conformed to modern programming best practices! ok(here.contains(‘shoemaker’)) ok(now() >= midnight) ok(now() <= sunrise) elf.enter() while not shelf.isfull(): elf.makeshoe() ok(shelf.is_full()) Yea, I’m weird. I know.

Search functions typically bring back more results than your user really wants to see. Luckily, Django does Pagination. I cannot express how awesome it is to have a typical feature like that done once, done right. Batteries are, indeed, included.