Sunday, July 16, 2006

Offensive Coding

Michael Feathers wrote an interesting article on checking for null arguments in a non-public method. Although the example that he gives is clear, it does raise the question of how defensive should our programming be where we have less control.

In a related issue, Mr. Feathers had a link in his post to an article on run-time versus compile-time type checking. This is a debate that is becoming more heated as dynamic languages such as Ruby become more popular. I'm not prepared to be dogmatic on this issue because I see good points on both sides. I guess I will be exploring the question myself since it looks like I'll be primarily working in C# and Ruby for the foreseeable future.

No comments: