When Visual Studio 2005 (formerly code-named “Whidbey”) came out as a beta, I installed it from our MSDN CD’s at work, and I’ve been keeping up with the technical preview releases since then … in case you haven’t, here’s my list of the top five reasons you want to upgrade to version 2.0 of the .NET Framework and Visual C# 2005 when it comes out:
Language Features
Generics
If you’re been following the Java language, you’ll recognize this as one of the key features of Java 5, and of course, if you have a C++ background, you’ll recognize these as “templates.” The biggest plus here is that we can have “generic” collections that can be created with a specific type in mind, no more boxing and unboxing things into objects just to get an ArrayList.
Anonymous methods
I’m sure Java developers are sneering at this point, and chuckling that it took C# “this long” to have anonymous methods… Basically, this is the “lambda function” of other languages (like Lisp), and it allows you to define a method on the fly to pass as an argument, or assign as an event handler or a “delegate.” It seems to be the last piece needed to bring C# full first class functions, where a method is just another data type that can be passed around.
IDE Features
Edit and Continue
Anyone who’s been a C++ developer and worked in Visual Studio is familiar with edit and continue. This is the magic that lets you make changes to your source code while you’re debugging, and essentially continue debugging from where you were, instead of having to stop, recompile, and start from the beginning again. When you’re working on a larger application or web project, or have to deal with logins, or multiple states, this saves you hours and hours of time, and is practically worth the cost of the upgrade, especially when you consider how much aggravation it saves you [ ].
Refactoring
Originally, I was going to leave this off, and make this a top three list (which somehow makes more sense to me), but when I thought about it, I realized that no list that includes the “new” features of the IDE would be complete without mentioning this. Refactoring is an idea which has matured as part of “Agile developement” but which is a perfectly obvious fit any time you’re doing Object Oriented Programming. Refactoring is basically about techniques for restructuring an existing body of code, altering its internal structure, without changing its external behavior. This includes such simple things as renaming variables, and such complicated things as changing a method signature and updating all the places where it is called. The new C# IDE in VS 2005 makes this easier, to make you more productive ( *insert joke on VB’s lack of refactorings *).

Form Editing enhancements
This, you have to try yourself. There are a few new controls, but the biggest thing in the new IDE is the way it helps you line things up, including lining edit boxes up next to buttons based on the text baseline, instead of the button size, and giving you visual and “gravitational” cues when things are lined up. Common actions for controls show up as “smart tags”, so you need that property page less and less.
There are plenty of other features in this release, which I won’t go into in detail, but here’s a brief list:
- Partial Types — which allow a single type, like a class, to be split into multiple files (great for team development and for working with automatic code generation tools like the GUI editor)
- Iterators — which make controlling enumeration of collections easier by managing the state of the iterator.
- Static classes —which help with design patterns by allowing the compiler to verify that a class has only static methods.
- Code Formatting — VS 2005 gives you almost complete control over every aspect of how the IDE formats your code, from whether you like spaced inside parentheses, to whether you want your if/else braces on a new line or not, and what color reserved words should appear in.
There are some minor enhancements to the way docking windows work, and to the default search options, as well as new options for the compiler, and the new MSBuild system (which I have yet to actually figure out). And when you’re debugging and you mouse over a variable you get a popup smart tag with a preview window that allows you to see everything you would otherwise have to create a “watch” variable to find out. Very handy.
All in all, I love it, and I’ve practically stopped using the VS 2003 IDE because of it.
Similar Posts:
- None Found
Generics: To me, this is reason enough to upgrade. In fact, I currently don’t allow my team to create “parameterized classes” (which, effectively, is what a template is) because C#‘s current support for such a mechanism just plain sucks. It’s beyond me why this wasn’t a core feature in the initial release.
Anonymous Methods: It’s all the more surprising that it took them this long to incorporate this feature given that the Active Scripting architecture has long accommodated this sort of thing (methods/functions are nothing more than COM objects).
Edit and Continue: Furthermore, it’s completely inane that you can’t just compile a single C# source file without building the entire project. Is this possible in VS 2005?
Refactoring: So how does VS 2005 better accommodate refactoring? We’re going to refactor the codebase of our web apps once we make to the move to VS 2005 (from VS 2002), but that won’t be until we’ve completely finished the production version of our flagship product (IOW, I have to be able to financially justify such an effort).
Form Editing Enhancements: Gah. I can’t remember the last time I used the Design View to work on a web form/user control. I’ll give it a try out of wanting to be fair, but I’m skeptical that VS will ever be able generate appropriate (subjectively defined, of course) HTML based on a RAD-based UI. Furthermore, the formatting of said generated HTML is absolutely horrendous. HTML View for me, baby.
Iterators: Care to elaborate? IMO, Enumerable collections are currently quite simple to create.
Generics: Why not until now? Because Worse is Better … or something. [
] Basically, you have to put some features off to later releases in order to get it out in a reasonable timeframe.
Compiling: Still can’t compile a single file in the C# IDE (you can in C++, and you can at the command-line, so … maybe it’s just a matter of a plugin).
As far as the form editing … I dono about HTML, I only use it for winforms. Actually, I haven’t really used ASP at all.
I edited the original article to answer questions about iterators and refactoring, I hope [
]