I saw in many code snippets that the following condition is used to check whether a list is empty:
List<string> someList = someFunctionThatPopulatesAList();
if (someList == null || someList.Count <= 0)
return;
I'm wondering - why not use the following condition instead:
if (someList == null || someList.Count == 0)
return;
Is there any case in which List<T>.Count
is negative?