Visual Studio 2008 Launch - Hands On Labs

I was just informed that all the Hands On Labs from the Visual Studio/Windows Server/SQL Server 2008 launch events are available online here.

I took a brief look at the "Visual Basic 9 Language Enhancements" lab and in general it looks good although it completely omits XML Literals and XML properties, I'm assuming because this lab was created before the RTM release. I'd take a look here for a good starting point on XML in VB. I also will plug my XML in VB webcast I did this morning that you can download.

The lab does have a chapter on lambda expressions so if you want to dive deeper into that topic you can have a look. The lab doesn't really get into the expanded query expressions that VB supports (which helps me avoid most common lambdas ;-) so you can have a look here and here for a good starting point.

I also noticed that the link for additional information in the beginning is pretty outdated. The help has been updated since these labs were created with more complete information. I'd suggest starting here instead. Or if you're really gutsy, read the VB 9 Language spec.

Also I noticed a small syntax error for array initializers. If you're having trouble on page 13 getting the syntax to work, you just need to add a parentheses to the square variable:

Dim square () = { _
New Point With { .X = 0, .Y = 5 }, _
New Point With { .X = 5, .Y = 5 }, _
New Point With { .X = 5, .Y = 0 }, _
New Point With { .X = 0, .Y = 0 } _
}

This will create an object array with 4 point objects inside and will only work if you have option strict off. It's much better to write:

Dim square As Point() = { _
New Point With { .X = 0, .Y = 5 }, _
New Point With { .X = 5, .Y = 5 }, _
New Point With { .X = 5, .Y = 0 }, _
New Point With { .X = 0, .Y = 0 } _
}

The rest of the chapter explains this so I think it was just a typo.

Enjoy!