8

I'm staring at the setter portion of a legacy VB property I came across.

This is crazy... right?

Set(value As String)
_firstName = value.Substring(0, value.Length)
End Set

Comments
  • 3
    There are no words. I have figuratively lost my voice.
  • 3
    A little bit, yeah :-) Maybe they just wanted to make "clear" that they wanted the entire string, and nothing less? :-)
  • 0
    Maybe they expected the param to be ByRef and wanted to make sure it was assigning a copy?
  • 1
    @Hultan70 I interpret it as such that they didn't want the string to be longer than its length.
Add Comment