TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

Nullable Types C# and VB.NET

Gee, which would you rather type?
 
Dim i As Nullable(Of Integer) = 100
i = New Nullable(Of Integer)(i.Value + 20)
 
     - or -
 
int? i = 100;
i = i + 20;

Digg!

posted on Monday, June 07, 2004 5:08 PM

Feedback

# re: Nullable Types C# and VB.NET 7/24/2006 2:47 AM John

Gee, which would the newbie on the team be better at reading?

As long as they compile the same, I'm all for easier-to-read code.

# re: Nullable Types C# and VB.NET 7/24/2006 10:21 AM Sean Chase

"Hey newbie...the '?' after the word 'int' means it's nullable." Problem solved.