Saturday, June 02, 2007

Background Compilation and TDD

Jeff Atwood has been blogging about the lack of background compilation in C# within Visual Studio (here and here); a feature that is built into the VB.NET editor of Visual Studio. I'll have to agree, for the most part, that background compilation can be useful at preventing common mistakes, especially in an environment where case sensitivity is important. And one of his readers pointed out that ReSharper includes background compilation for those of us who are lucky enough to have this tool. But background compilation, and even intellisense in general, annoy me during TDD sessions.

It is often the case, when writing code test first, that a class you are using does not exist yet and the method you are testing does not either. In each of these scenarios, background compilation becomes a little distracting as I immediately switch gears to eliminate the squiggles and the types that are now colored red. I find myself being pulled away from the task at hand: thinking about my design. This is certainly a personal issue and has me thinking that I should look into creating (and I don't even know if this is possible) shortcuts for disabling and enabling intellisense and background compilation. This may even solve the issue for those of us that think background compilation is annoying because "I haven't finished typing yet."

No comments: