This 5-part blog series will help you, dear reader, to understand what new features will be directly supported inside of Visual Studio Express 2008.
In this post, I'll give a quick overview of the most common questions still asked about Express and then dive into some of the language enhancements coming in 2008. Where appropriate, I'll list which Express product or language includes what features.
One key thing that Express has always been about is enabling full access to the programming language as well as to the .NET Framework and this continues to be true for Visual Studio 2008. Visual Studio Express 2008 fully supports Language INtegrated Query (LINQ) which adds language query capabilities (similar to SQL) directly into the Visual Basic and C# languages. What that means is that you can query databases, XML files like RSS feeds, or in-memory objects all using a single syntax. Hand-in-hand with LINQ are a number of language enhancements that simplify working with .NET data types that really shine when working in tandem with LINQ queries. Below is a quick walkthrough of a number of the language enhancements in action as we use LINQ to query create a list of Web site classes.
Visual Basic Example
Visual C# Example
Result
Walkthrough
1 - Auto-Implemented Properties (C#) - The "Site" class uses the new Auto-Implemented Properties feature for both "Name" and "Uri" which means you don't have to manually create a private back-store variable (ex: private string _Name;)as you would with a normal property in C# 2.0.
2 - Inferred Data Type (VB, C#) - Notice that rather than explicitly declare the data type for "mySites", instead we use Dim for Visual Basic or the new data type var, for C# which refer to an inferred data type in that it will figure out (rather than you having to explicitly write out) the data type for "mySites".
3 - Array Initializers(VB, C#), Collection Initializers(C#), and Object Initializers (VB, C#)
4 - Inferred Data Type, LINQ query, Anonymous type (projection) - This line of code is a bit complex, so we'll break it down into it's pieces:
5 - Custom Extension Methods - Extension methods enable you to add new methods to classes without manually adding the method to each specific type. The example in #5, shows how to create an extension method for any IEnumerable data type that loops through and prints each item to the console. Note that for Visual Basic, you must including the Imports System.Runtime.CompilerServices to be able to add an extension method.
Aside: Underneath the covers, LINQ syntax including from, where, select are really just extension methods with a sprinkle of syntactic sugar for easier readability.
XML Literals (VB)
Another big feature that can be used in tandem with LINQ is XML Literals, which enable you to add XML code directly inline with your Visual Basic application by simply adding xml tags for markup and <%= and %> for source code (similar to VBScript with classic ASP). In this example, we'll create a snippet of XML with the name and url by mixing and matching LINQ and XML markup tags.
While this is not a definitive list of all of the new language features for Visual Studio Express, you can see that Express still provides full support for the language enhancements coming for 2008.
Coming Soon: Part 2 Code Editor and UI Designers