Working With Visual Studio 2010 C# and .Net 4
Visual Studio 2010 Beta 2 is out and this release is much more stable and functional than the first beta. Microsoft has targeted the release of the final version sometime by March next year. This is a major release of Visual Studio and an important upgrade to .Net in many ways.
The New Visual Studio IDE

On the IDE side, the 2010 version of Visual Studio is built using WPF. This is a landmark event in the development of WPF technology that Microsoft has been trying to push very hard as a replacement for Winforms. The adoption of WPF by Microsoft to make the IDE of popular software like Visual Studio will be a sure-shot boost for its popularity and you should see some interesting action in the WPF world in the days to come.
Of course it also means that the IDE is a lot more fluid and interesting than earlier. All of the features that you’ve been using in earlier versions of the VS are all there too. New features include a Visual UML design tool that will help you simplify object designs on professional projects, a better debugger and better support for teams in the higher versions.
It is slightly more resource hungry than VS 2008, but you should be alright if you’ve upgraded your computer in the last 3 years and have at least 2 GBs of RAM.

Smaller Framework for Deployment
If you’ve tried a fresh install of .Net 3.5 on a computer, you already know how long it takes. The full download is above 200 MBs and takes more than 15 minutes to install on a PC. That’s way too much time than one can accept.
Microsoft has created another subset of the .Net framework that they call the ‘.Net Framework 4 Client Profile’ that reduces some of the clutter in the framework and concentrates only on the things that would be required for client application deployment. According to Microsoft this will meet the requirement 90% of the time, and for projects which need the entire framework, they can use that instead of the Client Profile.
I think this is an important development because it will make the framework accessible again and will make deployment easier.
Innovations in C# .Net 4
.Net 4 is an important milestone in the evolution of .Net. The last three versions of .Net (.Net 2, 3 and 3.5) were built on the same codebase, i.e. the version 3 and 3.5 were actually upgrades and were not installed separately like .Net 1.1 and .Net 2 were. You couldn’t remove them individually. This changes with .Net 4.
.Net 4 again has a separate installation and you can install and uninstall it without affecting your installation of .Net 1.1 or .Net 2. But that’s not all the change there is. You will find some really interesting developments in the new .Net.
Support for Dynamic Languages
.Net has traditionally been the domain of object oriented languages like C#, C++, and VB.Net. But of late there have been very interesting developments in the world of functional programming. Languages like Python and Ruby are very popular and ports of them have been available for .Net too. With support for Dynamic programming natively built in the framework, communicating and working with languages like Python and Ruby (IronPython and IronRuby implementations) is going to be very easy from your C# app too.
Microsoft has also introduced a new section of the framework called the DLR (Dynamic Language Runtime) which exposes new types and objects to work with Dynamic programming. In fact with the DLR you can write dynamic code within traditionally object oriented languages like C# itself.
Although the DLR exposes a whole set of dynamic objects that you can use to connect to different kinds of dynamic data, you would typically start using dynamic data with the freshly introduced ‘dynamic’ type.
Objects that are declared type dynamic support ‘late-binding’, i.e. when you call a function or a property against that object, the compiler does not check whether the property or the function exists at runtime, instead this is done at design time. This feature has been a part of Visual Basic for a long time, and is what made the notorious variant variables work. But don’t treat dynamic like a variant, it is not a variant.

Look at the sample code above. I’ve used assigned an instance of a C# class to a dynamic variable. I can call the members (methods and properties) of the class without worrying about compile time checking. If the method is found, the code runs fine. If not then there’s an error at runtime.
You won’t be making use of the dynamic keyword to reference C# code. That’s not a good idea at all. It should be used to connect with dynamic data.
F# Functional Language
Microsoft has also introduced its own functional programming language called the F# (F-Sharp). The F# is based on ML but with important improvements. Although it hasn’t hit production stage yet, you can call the components developed in F# from within your C# or VB.Net code.

At the moment F# can be used to create console applications and DLLs. The language is still in its preview, but it will ship with Visual Studio 2010 final launch.
The support for Dynamic programming also enables better support for COM applications.
Support for Optional and Named Parameters in C# 4
C# the flagship language for the .Net finally gets a much in demand feature – optional parameters. Adoption of Optional Parameters has b= een delayed so long because the C# team wasn’t actually convinced that this would be a good design strategy, however it is important if you’re doing a lot of work with COM objects because it will save you a lot of typing.
Optional parameters means you don’t have to write as many overloads as you used to and if a user does not give a value to an optional parameter the default value will take over. Named Parameters let you shuffle the order you supply the parameters for a function or skip some parameters by specifically providing the values to a few parameters. This feature too is important to save time and avoid code-bloat when working with COM.
Contra and Co-variance Support
Support for Contra and Co-variance will make implicit casting more intuitive and hassle free. Conversions that should have worked, and didn’t work earlier will now work implicitly. Which means you can do things like assigning list of string to a list of objects.
Innovations in ASP.Net
The Internet is the desktop PC of the new age. More and more applications that traditionally could be written ‘only’ for the desktop PC are finding their place on the Internet. Microsoft began the work of overhauling its Internet platform ASP.Net a little while ago, and they’re doing a great job in VS 2010.
ASP.Net MVC Now a Part of the IDE
ASP.Net MVC was introduced by Microsoft in 2007 as a new way of making web-applications. Built on the MVC (Model-View-Controller) pattern makes testing easy and removes several ASP.Net Webforms evils like Viewstate, etc.
ASP.Net MVC 2 will ship as a part of the IDE (no separate install) in 2010. Already the popularity of MVC is soaring and with its inclusion in Visual Studio, you can expect more interesting websites to be built using MVC.

Old ASP.Net Controls Upgraded to Spew Better Markup
It has been very hard for a finicky programmer to continue using ASP.Net controls once he discovers the kind of HTML markup it spews. Most ASP.Net controls were not awfully well written, and they markup they created was below standards of semantic web-design, and they weren’t very flexible either. That’s why many programmers would stop using the ASP.Net controls once they realized what was going on.
In VS2010 this has changed. Most of the ASP.Net controls have been updated and the ‘gnarly’ markup has been removed. Instead the programmer has more power to make the controls churn out the kind of markup he wants. This could be a major shot in the arm for ASP.Net controls.
The Web.Config File Has Less Clutter

The Web.Config file was clean in .Net 1.x, but 2.0 onwards the file became more and more cluttered because the .Net team was referencing all the fresh components in the Web.config file. It made the config file harder to manage and if something was inadvertently changed, it would make the entire application fail and debugging would be very hard.
In .Net 4, the web.config file has been cleaned up and all the references have been moved out into the machine configuration. So control of the config file is now once more with the programmers.
Silverlight & WPF
Silverlight has also been made a core-part of the Visual Studio in 2010. WPF, the successor to WinForms has also been upgraded and several new controls have been added to the repertoire. There have been several new additions to the graphics performance core of WPF, and the enhancements will improve make the graphics run faster than earlier thanks to things like Caching of graphical data.
The text-rendering engine of WPF has been totally revamped, giving you sharper text and better control over how text is rendered in your UI.
Conclusion
In two specific ways this version of Visual Studio is very radical. The first is the adoption of WPF for UI which will rouse confidence in the market for WPF usage and hasten its adoption, and the development of ASP.Net MVC as a powerful platform for web development. These two products have far reaching implications and will emerge as very important platforms in the near future.
The Beta of the Visual Studio 2010 is free, so if you haven’t tried it out yet, go ahead and do that.