Chapter 5

Advanced Language Constructs

What's in this chapter?

Using and Understanding Lambda Expressions

An Easy Way to Perform Tasks Asynchronously

Working with Custom Iterators

Wrox.com Code Downloads for this Chapter

The wrox.com code download for this chapter is found at www.wrox.com/remtitle.cgi?isbn=9781118314456 on the Download Code tab. The code is in the chapter 5 download and follows the single project sample application first discussed in Chapter 1, with some minor updates.

With any language, developers are typically provided with multiple ways to perform a given action. Some of these methods are easier and more efficient than others. One cause of this is simple growing pains. As a language evolves and grows, older ways of performing some functionality are replaced by more robust, efficient, and typically easier methodologies.

This is no different with Visual Basic 2012, which has many new features and improvements. Some of these come from its aforementioned growth as a language, while some can be attributed to its close relationship with C#. While C# may gain some new features and improvements first, Visual Basic is usually not far behind.

The focus of this chapter is to dive into several language features of Visual Basic that provide more advanced functionality. These features are deeply rooted into the framework and have very widespread uses, making them capable of fulfilling many needs. These features can be used to improve the overall appearance and flow of an ...

Get Professional Visual Basic 2012 and .NET 4.5 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.