4 ms·
I think his example using LINQ vs loops is not realistic - if you're using arrays like he is who's going to use LINQ with that ? The only reason I would specify
by rubber_duck 11y ago
I think his example using LINQ vs loops is not realistic - if you're using arrays like he is who's going to use LINQ with that ? The only reason I would specify a concrete type like that is if I cared about performance - otherwise you'd just specify IEnumerable/IList/IReadOnlyList or whatever and then use LINQ because it's cleaner. Use abstract interface when you don't care about performance at all - and IMO over 80% of the code is like that - initialization code, edge cases, stuff that gets touched less than a 0.01% of execution time and spending the time to optimize is simply not worth it.
He starts the article by judging laziness - after spending a lot of time on stuff that ends up being irrelevant in retrospective I wish I was more lazy about this stuff.