David Hayden [MVP C#]

Sponsors

The Lounge

News

  • CodeBetter.Com Home

Other Links

Teas

Patterns & Practices

Florida .NET Developer

Book Reviews

Tampa ASP.NET MVC Developer Group

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Visual Studio 2008 SP1 "Background Compiling" for C#

I don't know the proper term for the new functionality in Visual Studio 2008 SP1 for C# that does code anaysis and finds compilation errors without an explicit compile ( what I would term "Background Compilation" ), but Scott Guthrie provides the following description:

"The C# code editor now identifies and displays red squiggle errors for many semantic code issues that previously required an explicit compilation to identify.  For example, if you try to declare and use an unknown type in the C# code-editor today you won't see a compile error until you do a build.  Now with SP1 you'll see live red squiggle errors immediately (no explicit compile required):"

Holy time savings Batman, this is much needed functionality for those developers who are not using ReSharper or another tool that provides similar code analysis in the background. I had to jump on my development machine that is not running the Visual Studio 2008 SP1 Beta just to make sure this background compilation wasn't already being done in Visual Studio 2008.

I didn't put the feature through a thorough testing, but I was just happy that it would identify unknown classes and other little things. The red squiggles are a huge time saver.

 

 

 

This is worth Visual Studio 2008 SP1 alone. And, no, I don't know what performance impact this has on large projects :)

 

Recent Visual Studio 2008 SP1 Beta Posts:

 


Posted Tue, May 13 2008 2:41 PM by David Hayden

[Advertisement]

Comments

Neil wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Tue, May 13 2008 3:20 PM

I haven't used this yet, but I really hope that it is not as much of a pain as the equivalent functionality that VB.NET provides. It may be my machine is not zippy enough, but for me in VB it turns coding into a slow and painful experience as after typing keywords your flow of typing is interrupted by VS checking what you have typed.

I've always enjoyed that this did not happen with C#, especially as such mistakes are quite rare, and sometimes intentional (if you haven't added the method declaration yet but are about - such as when writing a unit test).

Also will the bottom-left or bottom-right underscores that offer to add using statements, or to implement methods now be obscured by the squiggles? I hope not.

Derik Whittaker wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Tue, May 13 2008 4:12 PM

So how does this really differ from what R# gives you besides the fact that it is built in?

Also, wonder how it plays with R#

David Hayden wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Tue, May 13 2008 4:51 PM

I am not sure.

I suspect Visual Studio 2008 SP1 is just doing a "compile" in the background and displaying compiler related errors. As you know, ReSharper goes well beyond compiler errors and gives you warnings and code suggestions that would not be picked up by the compiler.

My favorite example of this is ReSharper's notification icon ( warning ) for an infinite loop in the code :)

David Hayden wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Tue, May 13 2008 4:57 PM

Neil,

In the options for the C# editor there are a couple of options that you can turn on and off:

- Underline errors in the editor.

- Show live semantic errors.

It sounds like you have the option to not use this feature if you find it causes you performance problems or is not visually appealing.

Chris Holmes wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Tue, May 13 2008 6:34 PM

"...this is much needed functionality for those developers who are not using ReSharper or another tool that provides similar code analysis in the background."

Do those developers really exist?

David Hayden wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Wed, May 14 2008 8:56 AM

Chris,

It is hard to believe, I know :) There are a number of other tools that do not provide "background compiling" or code analysis ( mainly just code highlighting, various macros, etc. ) that a lot of people use and will benefit from this new feature for C# I suspect.

Personally, I probably won't use it.

Venkat wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Thu, May 15 2008 2:11 AM

It's there in eclipse for Java from years...Any way great to have this feature....

David Hayden wrote re: Visual Studio 2008 SP1 "Background Compiling" for C#
on Thu, May 15 2008 11:35 AM

Venkat,

I have heard the same thing about IntelliJ IDEA from JetBrains as well. I think developers coming from the Java world to .NET miss a lot of the functionality they have enjoyed for years from Java tools in the past.