BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Lambda Expression Improvements for VB

Lambda Expression Improvements for VB

This item in japanese

Bookmarks

For VB developers it is a toss-up for the most frustrating thing about anonymous functions. In no particular order they are:

There is no way to create an anonymous subroutine, i.e. a function that doesn’t return a value. This means VB developers cannot directly use any method requiring an Action(Of T) such as IEnumerable.ForEach.

Next up is the lack of multi-line anonymous functions. While merely frustrating at this point, it will become downright critical in the near future. Several of the coding patterns needed to use Parallel FX, including the very promising Parallel.For loop, all but require the use of multi-line anonymous functions.

Finally there is the syntax. When you have to use several anonymous functions in a single line the syntax just feel clumsy.

Well for two of these the solution is at hand. While Paul Vick made no promises, the next version of VB is all but certain to have anonymous subroutines and multi-line functions.

As for the syntax, who knows? C# changed theirs when they moved from 2.0 to 3.0, so it wouldn’t be completely unreasonable for VB to do the same. But then again, there are no obvious candidates and VB traditionally solves this type of issue with IDE enhancements.

Rate this Article

Adoption
Style

BT