Usually we should program to interfaces, not implementations, to abstract implementation details and focus on behaviour.
I think it is more fair does not obligate implementations to return a specific type (eg. List) @joelverhagen
If some implementation can work better with IEnumerable instead of List, I dont see any reason to force it get worse.
Obligate implementations to use list hurt performances unnecessarily because as the size of the list gets larger, it has the cost of creating a new buffer internally and copy over all of the existing elements.
So this PR makes 2 adjusts:
adjusts to ICsvReader returns IEnumerable instead of List
adjusts some implementations to use yield return instead of mandatorily return a List
Usually we should program to interfaces, not implementations, to abstract implementation details and focus on behaviour. I think it is more fair does not obligate implementations to return a specific type (eg. List) @joelverhagen
If some implementation can work better with IEnumerable instead of List, I dont see any reason to force it get worse.
Obligate implementations to use list hurt performances unnecessarily because as the size of the list gets larger, it has the cost of creating a new buffer internally and copy over all of the existing elements.
So this PR makes 2 adjusts:
yield return
instead of mandatorily return a ListI can revert point 2 if wanted.