Click here to Skip to main content
15,881,455 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu9-Feb-21 2:28
MeziLu9-Feb-21 2:28 
GeneralRe: Unpopular opinions: LINQ Pin
honey the codewitch9-Feb-21 2:29
mvahoney the codewitch9-Feb-21 2:29 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu9-Feb-21 2:39
MeziLu9-Feb-21 2:39 
GeneralRe: Unpopular opinions: LINQ Pin
honey the codewitch9-Feb-21 2:47
mvahoney the codewitch9-Feb-21 2:47 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu9-Feb-21 2:56
MeziLu9-Feb-21 2:56 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu9-Feb-21 3:05
MeziLu9-Feb-21 3:05 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu9-Feb-21 2:52
MeziLu9-Feb-21 2:52 
GeneralRe: Unpopular opinions: LINQ Pin
Member 140926059-Feb-21 2:31
Member 140926059-Feb-21 2:31 
Performance should never be the only consideration, and in most cases not even the most important one. One big advantage of LINQ is that you have the same set of functions, no matter what data source lies behind the data. It might be a local System.Collections.Generic.List generated on-the-fly, but it might as well be an SQL or SOAP connection providing the data collection. Either way, you should always consider the cost when calling LINQ functions. So calling Enumerable.Count() without important reason is usually not a good idea, as this will iterate over all items.

Another advantage is readability. Of course only when you know how to read LINQ.

In performance-critical scenarios though, the cost of generating an enumerator just for the sake of being able to use LINQ (e.g. for an array, which doesn't come with its own enumerator) might be relevant. But you should decide on a case-by-case basis instead of generalizing the decision for or against LINQ. "Only a Sith deals in absolutes." Wink | ;-)
GeneralRe: Unpopular opinions: LINQ Pin
honey the codewitch9-Feb-21 2:39
mvahoney the codewitch9-Feb-21 2:39 
GeneralRe: Unpopular opinions: LINQ Pin
obermd9-Feb-21 3:08
obermd9-Feb-21 3:08 
GeneralRe: Unpopular opinions: LINQ Pin
MeziLu10-Feb-21 13:55
MeziLu10-Feb-21 13:55 
GeneralRe: Unpopular opinions: LINQ Pin
TnTinMn9-Feb-21 3:43
TnTinMn9-Feb-21 3:43 
GeneralRe: Unpopular opinions: LINQ Pin
honey the codewitch9-Feb-21 3:54
mvahoney the codewitch9-Feb-21 3:54 
GeneralRe: Unpopular opinions: LINQ Pin
Bruce Greene9-Feb-21 5:54
Bruce Greene9-Feb-21 5:54 
GeneralRe: Unpopular opinions: LINQ Pin
Member 129243129-Feb-21 8:20
Member 129243129-Feb-21 8:20 
GeneralRe: Unpopular opinions: LINQ Pin
Eddy Vluggen9-Feb-21 8:56
professionalEddy Vluggen9-Feb-21 8:56 
GeneralRe: Unpopular opinions: LINQ Pin
Bruce Patin10-Feb-21 4:23
Bruce Patin10-Feb-21 4:23 
GeneralRe: Unpopular opinions: LINQ Pin
honey the codewitch10-Feb-21 4:34
mvahoney the codewitch10-Feb-21 4:34 
Generalcorrection: Microsoft is a virus. They wreck every software tool they try to re-brand as a Microsoft product. Pin
Member 117206818-Feb-21 6:03
Member 117206818-Feb-21 6:03 
GeneralRe: correction: Microsoft is a virus. They wreck every software tool they try to re-brand as a Microsoft product. Pin
User 149368538-Feb-21 6:27
User 149368538-Feb-21 6:27 
GeneralRe: correction: Microsoft is a virus. They wreck every software tool they try to re-brand as a Microsoft product. Pin
dandy729-Feb-21 4:00
dandy729-Feb-21 4:00 
GeneralRe: correction: Microsoft isn't a virus. Pin
OriginalGriff8-Feb-21 6:26
mveOriginalGriff8-Feb-21 6:26 
GeneralRe: correction: Microsoft isn't a virus. Pin
honey the codewitch8-Feb-21 6:33
mvahoney the codewitch8-Feb-21 6:33 
GeneralRe: correction: Microsoft isn't a virus. Pin
User 149368538-Feb-21 7:01
User 149368538-Feb-21 7:01 
GeneralRe: correction: Microsoft isn't a virus. Pin
honey the codewitch8-Feb-21 8:09
mvahoney the codewitch8-Feb-21 8:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.