Summary
VB.NET does not yet support Dim tuple deconstruction syntax, despite consistent community requests dating back to 2018 (see: dotnet/vblang#346). As of 2026, modern coding tools and third-party extensions have begun emulating this syntax, highlighting strong demand for first-class support.
This feature would bring VB.NET parity with modern tuple patterns, improve code brevity, and simplify common patterns like deconstruction, inline out variables, and value discards.
Proposed Syntax & Examples
1. Tuple Deconstruction with Dim (Type Inference & Explicit Typing)
Support direct tuple deconstruction using the Dim statement, with both inferred and explicit type support:
' Dim tuple syntax with local type inference
Dim (a, b) = (3, 5)
' Explicit type annotation for tuple elements
Dim (a As Integer, b As Integer) = (3, 5)
2. Discard Slots (Empty Deconstruction Slots)
Allow empty slots in tuple deconstruction to discard unused values (a common and useful pattern in modern .NET languages):
' Discard the first value; assign only the second and third elements
Dim (, a, b) = (3, 5, 7)
' Result: a = 5, b = 7; first value (3) is ignored
3. Inline Dim for C#'s out Variables
Simplify the usage of C#'s out parameters in VB.NET with inline Dim syntax (automatic type inference, no pre-declaration required):
Dim input = Console.ReadLine()
' Inline Dim for out variable - type is inferred automatically
If Integer.TryParse(input, Dim x) Then
' x is strongly typed as Integer
Dim y = 3 * x - 2
Console.WriteLine("x = {0}, y = {1}", x, y)
End If
' Discard the out variable entirely using an empty slot
If Integer.TryParse(input, ) Then Console.WriteLine("Input is a valid integer.")
Motivation & Benefits
- Modernize VB.NET: Align with contemporary .NET language patterns for tuples and discards.
- Reduce Boilerplate: Eliminate redundant variable declarations for
out parameters and tuple unpacking.
- Community Demand: Long-requested feature with widespread support from VB.NET developers.
- Tooling Consistency: Match the behavior already being emulated by popular coding tools.
In conclusion, as both a C# and VB.NET developer, I strongly encourage the VB.NET language team to prioritize implementing this critical productivity feature. Many thanks for your consideration!
Summary
VB.NET does not yet support
Dimtuple deconstruction syntax, despite consistent community requests dating back to 2018 (see: dotnet/vblang#346). As of 2026, modern coding tools and third-party extensions have begun emulating this syntax, highlighting strong demand for first-class support.This feature would bring VB.NET parity with modern tuple patterns, improve code brevity, and simplify common patterns like deconstruction, inline out variables, and value discards.
Proposed Syntax & Examples
1. Tuple Deconstruction with
Dim(Type Inference & Explicit Typing)Support direct tuple deconstruction using the
Dimstatement, with both inferred and explicit type support:2. Discard Slots (Empty Deconstruction Slots)
Allow empty slots in tuple deconstruction to discard unused values (a common and useful pattern in modern .NET languages):
3. Inline
Dimfor C#'soutVariablesSimplify the usage of C#'s
outparameters in VB.NET with inlineDimsyntax (automatic type inference, no pre-declaration required):Motivation & Benefits
outparameters and tuple unpacking.In conclusion, as both a C# and VB.NET developer, I strongly encourage the VB.NET language team to prioritize implementing this critical productivity feature. Many thanks for your consideration!