Performance is one of the reasons for choosing one or the other. Choosing .Count () means your code will be more general. I had cases where I reorganized some code that no longer created a collection, but instead became something more general, like IEnumerable, but the other code broke because it depended on .Count , and I had to change it on .Count() , If I tried to use .Count() everywhere, the code would most likely be more reusable and maintainable. Usually preferring to use more general interfaces, if you succeed, this is your best bet. More generally, I mean a simpler interface that is implemented by more types, and thus you get more compatibility between the code.
I'm not saying .Count() better, I'm just talking about other considerations that are more about reusing the code you write.
AaronLS 03 Oct '12 at 16:23 2012-10-03 16:23
source share