WTF (1)

Let me start by pointing out that VisualBasic is not my cup of tea. I don’t like all those implicit castings. Like this:

[sourcecode language='vb']Function DecimalSeparator() As String
DecimalSeparator = (1 / 2).ToString.Substring(1, 1)
End Function[/sourcecode]

The .Net way of doing things is of course:

[sourcecode language='vb']Function DecimalSeparator() As String
Return System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
End Function[/sourcecode]

But I guess that was too much for this programmer.

Leave a Reply

You must be logged in to post a comment.