I\'m normally at home in C#, and I\'m looking at a performance issue in some VB.NET code -- I want to be able to compare something to the default value for a type (kind of l
Unlike C#, VB.NET doesn't require a local variable to be initialized with an expression. It gets initialized to its default value by the runtime. Just what you need as a substitute for the default keyword:
Dim def As T2 '' Get the default value for T2
If id.Equals(def) Then
'' etc...
End If
Don't forget the comment, it is going to make somebody go 'Huh?' a year from now.