Microsoft has released details about Visual Basic 14, the new version of Visual Basic set to ship with Visual Studio 2015.
According to a blog post from Visual Basic program manager Lucian Wischik, Visual Basic is skipping from 12 to 14 to keep in line with Visual Studio’s numbering.
The new VB language features are focused on two overall themes, according to Wischik: Cleaning up common coding patterns with easier syntax, and fixing some irritating corners of the language.
(Related: Visual Basic popularity climbs in TIOBE index)
The most significant feature additions in Visual Basic 14 will be:
- The ?. operator: A new operator makes it easier to do a null check in production-quality code.
- The NameOf operator: An operator with identical “before” and “after” behavior, Wischik explained, NameOf returns constant string code during compilation, and works with IDE features including, Rename and Find All References.
- String interpolation: A syntactic shorthand for String.Format allows for format specifiers and different culture values, with the ability to extract raw format-string and arguments.
- Multiline strings: Direct support of multiline strings eliminates the need for XML literal workarounds, making VB string literals exactly like C# verbatim strings, according to Wischik.
- Read-only auto-properties: Simplification of read-only auto-properties allows initialization inline or in the constructor, as with normal properties.
- Comments: Comments are displayed in statements that split over multiple lines.
The full list of incoming features set to ship with Visual Basic 14 is available on CodePlex.