D Stanley February 2016
I can think of 3 reasons (in no particular order):
When the method was developed there were no generics, and thus no
string was the best strongly-typed option available at the time.
You can't overload methods by return type, so it would have to either be called something like
GetListOfFiles() (bad) or be a breaking change (very bad)
it's just as easy to do:
Dim nNewListOfString As New List(Of String) (System.IO.Directory.GetFiles(uInitDir))
Plus you don't need to
ReDim your array as mentioned in the comments to your question. You can just do:
Dim nNewStringArray() As String
nNewStringArray = System.IO.Directory.GetFiles(uInitDir)
Dim nNewStringArray() As String = System.IO.Directory.GetFiles(uInitDir)
if you prefer. The only reason I would turn the results into a
List is if I were going to add items to it. Pretty much anything else can be done with an array.