VB 2010 Unveiled at PDC 2008! (Lisa Feigenbaum)

Published 02 November 08 03:34 PM

Last week at the Professional Developers Conference, we made a number of very exciting announcements regarding the future of Visual Basic. Here is the list of VB 2010 features we've announced:

  • Collection Initializers. Initialize collections in fewer lines of code! Use the "From" keyword followed by a list, rather than successive calls to the Add method.
    • Dim y As New List(Of String) From {"hello", "world"} 
    • Dim x As New Dictionary(Of String, Integer) From {{"hello", 1}, {"world", 2}}
  • Array literals. Express arrays more concisely. Whereas before you used to have to write New Integer() {1,2,3}, now you can just write {1,2,3}. Leave it to the compiler to infer the type of the items in the array! This can be very convenient wherever you use arrays.
    • 2D array: {{1,0},{0,1}}
    • Jagged array: {({1,2,3,4}),({1,2})}
  • Statement lambdas. Visual Basic 2008 enabled lambda expressions. Now you can write multi-line lambda subs or functions as well!
    • Define a Sub or Function anywhere a delegate is expected.
  • Auto-implemented properties. Eliminate 8 out of 9 of the lines you write for boiler-plate VB properties today!
    • Expanded property syntax:
          Private m_Id As Integer
          Public Property Id() As Integer
              Get
                  Return m_Id
              End Get
              Set(ByVal value As Integer)
                  m_Id = value
              End Set
          End Property
    • Auto-property syntax, new in VB 2010:
          Public Property Id() As Integer
    • Auto-property syntax, with an initializer:
          Public Property Id() As Integer = 100
  • Removal of the line continuation character. Underscores are no longer needed in the most common line continuation scenarios. Can you believe it?!?!
    • Attributes, argument lists, parameter lists, queries, and binary operators are some of the most common scenarios for an underscore. In VB 2010, you can now write these lines underscore-free!
    • What are we to do with all those unused underscores? Check out http://www.unemployedunderscores.com
  • Generic co- and contra- variance. Code that used to generate errors will now work error-free! See Lucian Wischik's blog posts on this new feature, which has been enabled by CLR 4.0.
  • No PIA. Deploy your Office applications without the bulky primary interop assemblies! VB 2010 will embed the Office types your application depends on, right into the app itself. No more need to deploy large PIAs.
  • Interop with dynamic languages. VB 2010 offers improved support to interoperate with dynamic languages. Dynamic and static languages each have their own benefits, libraries, and particular scenarios for which they are better suited. With VB 2010, you no longer need to choose just one! You can use dynamic languages directly from VB.Net as needed.

So many exciting features to look forward to! Stay tuned for more blog posts and videos which illustrate these features in more detail.

by VBTeam

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# infoblog » VB 2010 Unveiled at PDC 2008! (Lisa Feigenbaum) said on November 2, 2008 7:43 PM:

PingBack from http://blog.a-foton.ru/index.php/2008/11/03/vb-2010-unveiled-at-pdc-2008-lisa-feigenbaum/

# The Visual Basic Team said on November 2, 2008 8:02 PM:

Didn't make it to the PDC? No problem. You can still check out the *hottest* presentation at the Professional

# The Visual Basic Team said on November 2, 2008 8:56 PM:

I recently blogged about the new VB 2010 language features announced at PDC, as well as the video available

# VB Feeds said on November 2, 2008 9:13 PM:

I recently blogged about the new VB 2010 language features announced at PDC, as well as the video available

# VB Feeds said on November 2, 2008 9:14 PM:

Didn't make it to the PDC? No problem. You can still check out the *hottest* presentation at the

# Jonathan Allen said on November 2, 2008 10:15 PM:

What about using Nullable(Of Integer) as a optional parameter?

I'm pretty sure Lucian showed that to me after his talk at the PDC.

# Lucian Wischik said on November 3, 2008 1:22 AM:

Thanks for the reminder, Jonathan. Yes, VB2010 allows nullables as optional parameters. Here are some examples.

Sub a(Optional ByVal x As Integer? = Nothing)

Sub b(Optional ByVal y As Integer? = 2)

Sub c(Optional ByVal x As Nullable(Of Integer) = Nothing)

Sub d(Optional ByVal y As Nullable(Of Integer) = 2)

Sub e(Optional ByVal z As MyStructure? = Nothing)

# Greg said on November 3, 2008 10:45 AM:

Please a refactoring to remove all line continuation characters.  This would save me many hours each month reformatting lame formatted .NET code written in VB6/classic ASP style.

# int19h said on November 4, 2008 9:42 AM:

How does the parser distinguish an auto-property declaration from a normal one? Does it look ahead for "Get" or "Set" token, and, if there isn't one, assumes an auto-property?

# JoeD said on November 6, 2008 7:52 AM:

How do auto-property declarations work with interfaces?

# John said on November 7, 2008 7:18 AM:

Still no unsafe code blocks!!!

# James said on June 28, 2009 10:47 PM:

I guess upto now they still haven't invested in making the .net framework thread safe.

Sigh...

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

This Blog

Syndication

Page view tracker