Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Should VB Break Backwards Compatibility (Again)?

Should VB Break Backwards Compatibility (Again)?

Paul Vick of Microsoft's Visual Basic team asks the VB community if they are willing to accept a breaking change in order to get a true ternary operator.

A long standing source of annoyance for VB programmers is the lack of a real inline if operator. Compared to the C family's ?/: pair, VB's IIF has some serious limitations.

The first problem is that it is always typed as object. This is a source of frustration for VB developers working on project with strict typing turned on as it almost always requires an additional cast.

The second issue is that unlike other languages, VB doesn't support short-circuiting. Both the true and false parts of the equation are always evaluated, making the operator useless in many situations.

In order to better support LINQ, Microsoft is considering changing the IIF operator to work the same way as it does in C#. However, this will result in a breaking change. The number of projects actually relying on the current behavior is probably very small, but for them the change may cause the project to silently fail.

Voice your opinion at Panopticon Central.



Rate this Article