S
Samuel R. Neff
Are there any differences between using Array.Length and
Array.GetUpperBound(0) on a one-dimensional array?
We have a team of developers and most people use Array.Length but one
developer uses GetUpperBound(0). I'd like the code to all be
consistent but would like to know if there is any other reason I can
provide to justify using only Array.Length instead of
GetUpperBound(0).
I read that Array.Length has special meaning to the compiler in that a
loop over an array in C# will bypass bounds checks within the loop
since the compiler knows ahead of time that all accesses will be
valid. Does VB.NET provide this same optimization? Does it apply
only to Length or does it also apply to GetUpperBounds(0).
Thanks,
Sam
B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
Array.GetUpperBound(0) on a one-dimensional array?
We have a team of developers and most people use Array.Length but one
developer uses GetUpperBound(0). I'd like the code to all be
consistent but would like to know if there is any other reason I can
provide to justify using only Array.Length instead of
GetUpperBound(0).
I read that Array.Length has special meaning to the compiler in that a
loop over an array in C# will bypass bounds checks within the loop
since the compiler knows ahead of time that all accesses will be
valid. Does VB.NET provide this same optimization? Does it apply
only to Length or does it also apply to GetUpperBounds(0).
Thanks,
Sam
B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.