2 ms·
I think you had misread it. Author was commenting on other developers who have written following code - "How often do .NET developers write something like this:
by mandeepj 8y ago
I think you had misread it. Author was commenting on other developers who have written following code - "How often do .NET developers write something like this:". And, was not promoting this approach.
var someCollection = GetSomeCollectionFromSomewhere();
if (someCollection != null && someCollection.Count > 0)
{
foreach(var item in someCollection)
{
// Do stuff
}
}