Critical Development

Language design, framework development, UI design, robotics and more.

Small Gems in Visual Studio 2008 SP1

Posted by Dan Vanderboom on August 20, 2008

The first service pack for VS2008 is packed full of development goodness.  The Entity Framework has finally shipped, and despite some ungracious criticism (that nevertheless addresses some real concerns), a good foundation has been laid for us to start reaping the benefits of using business objects (entities), and to provide a compelling alternative to those of us who have been using ORM for years already and are sick of our current ORM vendor.  Other major deliverables include ADO.NET Data Services, support for SQL Server 2008, improvements in both WPF designers and WPF application performance, greater flexibility in WCF, and more.  You can find details here.

What you won’t find listed among the updates are two gems explained in this video, in which Charlie Calvert interviews DJ Park, the Visual Studio IDE PM.  The primary topic of the video is Live Semantic Errors, manifested as “squiggles” in the text editor.  Until now, the only errors that were recognized and indicated by squiggles have been syntax errors: that is, errors discoverable by the compiler’s parser.  Now that the Language Analysis Framework (LAF) is in place, which is the bridge between Visual Studio and the compiler, the IDE can obtain much more information about the semantics of that code.  This enables error checking of complex expressions, field initializers, and so on, and the detected errors show up in the task list tool window for any error detected in open files.

Live Semantic Analysis is neat, but even better is the potential that the Language Analysis Framework has to eventually provide C# developers with something VB has had for a while, which is background compilation.  Whether the C# team is heading down this road or not is unclear.  I’ve made some inquiries, so we’ll see who knows what and is willing to talk about it.

Update: It appears there’s a fair amount of interest at Microsoft to provide incremental compilation in C# to allow edit-and-continue functionality, though this is perceived as a long-term trend and not something we might expect in C# 4.0.  Incremental compilation adds a lot of complexity to a compiler, and past research showed that the performance benefits weren’t worth the effort.  The C# team actually started building an incremental compiler years ago and eventually gave up on it.  With parallel computing within reach now, the gains could be much more substantial as long as sophisticated task dependencies can be coordinated and the complexity managed.  The future of compiler technology, programming languages, and development tools should be pretty exciting!

At the end of this video, DJ mentioned another new hidden feature in SP1.  Up until now, if you added a comment with a special tag such as //TODO: or //HACK:, they would show up in the Task List tool window, but only for open windows.  I spent a few hours (years ago) coming up with a organization scheme for using these, creating my own tags (under Tools—>Options—>Environment—>Task List) and placed them all over my code as reminders.  It’s a much more natural place to put extremely detailed tasks (as opposed to product feature requests) because comments are attached to the very bits of code that require changing, and all comments get checked in and versioned with the code.  So I was quite dismayed when they started disappearing as I closed one code window after another.  With SP1, these comments remain in the task list!  Hoo rah!  I think I’m more excited about this feature than the steroid-pumped squiggles.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: