> Maybe a better question is this: how do you write code that does the most possible to prevent a maintainer from screwing it up?
By writing tests, that's the only way.. I remember recently writing the test two weeks after I added the feature, the feature was already broken!
The difficulty is that maintainers are very creative in their way to break your code so it's difficult to write 'thorough' tests.