CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

David Hayden [MVP C#]

         .NET Tutorials, Patterns, and Practices

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:

 



Comments

Neil said:

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.

# May 13, 2008 3:20 PM

Derik Whittaker said:

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#

# May 13, 2008 4:12 PM

David Hayden said:

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 :)

# May 13, 2008 4:51 PM

David Hayden said:

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.

# May 13, 2008 4:57 PM

Chris Holmes said:

"...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?

# May 13, 2008 6:34 PM

David Hayden said:

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.

# May 14, 2008 8:56 AM

Venkat said:

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

# May 15, 2008 2:11 AM

David Hayden said:

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.

# May 15, 2008 11:35 AM
Check out Devlicio.us!

This Blog

Syndication

News

CodeBetter.Com Home