Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

3.3. VB.NET Changes

Although in this book I am mainly covering C#, for completeness I will cover changes to VB.NET as well.

3.3.1. Line Continuation

One of the aspects of VB.NET I really hated was the line continuation character (an underscore with a space before it). This particularly annoyed me when writing LINQ queries, because it made them less readable. Also, the underscore character is kind of awkward to type (OK, that's not that big an issue):

Dim numbers() As Integer = {1, 2, 3, 4, 5}
Dim query = from n in numbers _
             Select n _
             Where n>5

In .NET 4.0, in the majority of situations, this will no longer be necessary, as the compiler is now clever enough to work out how lines will be split. This then allows the above LINQ query to be rewritten ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book