>Writing documentation finds bugs in the code<p>This is so true. I've found documenting how a function should behave concentrates the mind on how it might actually <i>not</i> behave in that way and yields good tests that very often find bugs.