Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to organize this data Pin
PIEBALDconsult29-Dec-14 9:07
mvePIEBALDconsult29-Dec-14 9:07 
AnswerRe: How to organize this data Pin
BillWoodruff29-Dec-14 9:20
professionalBillWoodruff29-Dec-14 9:20 
GeneralRe: How to organize this data Pin
PIEBALDconsult29-Dec-14 10:04
mvePIEBALDconsult29-Dec-14 10:04 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 12:12
professionalBillWoodruff29-Dec-14 12:12 
GeneralRe: How to organize this data Pin
SledgeHammer0129-Dec-14 10:50
SledgeHammer0129-Dec-14 10:50 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 12:11
professionalBillWoodruff29-Dec-14 12:11 
GeneralRe: How to organize this data Pin
SledgeHammer0129-Dec-14 12:28
SledgeHammer0129-Dec-14 12:28 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 14:18
professionalBillWoodruff29-Dec-14 14:18 
Here's a challenge for you, Mighty Hammer: write a response to the OP here that demonstrates what you consider "best practices" Smile | :)

It's rather clear to me reading your responses that you do not understand Linq fully, and grasp that no "copy" is made of the whatever structure that is processed by a Linq query.

I think you also miss the Zen humor in Piebald's comment: to bake a puppy into a pie is, indeed, to transform it, and a Linq query result is a transformed, often filtered so one has a pointer to a subset of all possible objects; it's kind of a "map" to what will be finally rendered as a result of the transformation.

What I am surprised that neither you, nor Piebald, pointed out is that all of the Linq queries shown in this example act on all of the objects in the set: no filtering here; and it is correct that Linq queries that sort, and use of operators like Cast, will always have more potential overhead than Linq queries that use Linq operators, for example 'Where, that do filter.

I don't find your comments about "standard techniques" credible, which doesn't mean I don't believe that you have evolved a set of practices that are quite useful in the kind of code you write in the context of your work, and which you now believe are "standard." We all generalize from our experience in ways that both enable, and limit, us.

Code I write in response to questions on CP is written with the goal of educating the OP, and I try to make it as "general" as possible, to communicate its intent as clearly as possible. In writing this code I felt the example just might be more useful, in the long run, on CP, if I demonstrated using an Enum, using a Switch/Case, providing an example of a utility class with a gamut of useful options (the various sorts).

Some wise words by Jon Skeet concerning the "overhead" of Linq queries: [^].
«A man will be imprisoned in a room with a door that's unlocked and opens inwards ... as long as it does not occur to him to pull rather than push»  Wittgenstein

GeneralRe: How to organize this data Pin
SledgeHammer0129-Dec-14 14:58
SledgeHammer0129-Dec-14 14:58 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 23:44
professionalBillWoodruff29-Dec-14 23:44 
GeneralRe: How to organize this data Pin
SledgeHammer0130-Dec-14 4:13
SledgeHammer0130-Dec-14 4:13 
GeneralRe: How to organize this data Pin
PIEBALDconsult29-Dec-14 13:07
mvePIEBALDconsult29-Dec-14 13:07 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 23:15
professionalBillWoodruff29-Dec-14 23:15 
GeneralRe: How to organize this data Pin
SledgeHammer0130-Dec-14 4:17
SledgeHammer0130-Dec-14 4:17 
GeneralRe: How to organize this data Pin
BillWoodruff30-Dec-14 23:42
professionalBillWoodruff30-Dec-14 23:42 
GeneralRe: How to organize this data Pin
PIEBALDconsult30-Dec-14 15:29
mvePIEBALDconsult30-Dec-14 15:29 
GeneralRe: How to organize this data Pin
BillWoodruff30-Dec-14 23:53
professionalBillWoodruff30-Dec-14 23:53 
GeneralMessage Closed Pin
29-Dec-14 2:32
Marvic Grima29-Dec-14 2:32 
Questionserial port CreateFile in c# Pin
Member 1114321929-Dec-14 2:16
Member 1114321929-Dec-14 2:16 
AnswerRe: serial port CreateFile in c# Pin
OriginalGriff29-Dec-14 2:28
mveOriginalGriff29-Dec-14 2:28 
GeneralRe: serial port CreateFile in c# Pin
Member 1114321929-Dec-14 2:45
Member 1114321929-Dec-14 2:45 
GeneralRe: serial port CreateFile in c# Pin
Member 1114321929-Dec-14 2:55
Member 1114321929-Dec-14 2:55 
GeneralRe: serial port CreateFile in c# Pin
OriginalGriff29-Dec-14 3:42
mveOriginalGriff29-Dec-14 3:42 
Questionusing SqlConncetion Pin
Jassim Rahma29-Dec-14 1:16
Jassim Rahma29-Dec-14 1:16 
AnswerRe: using SqlConncetion Pin
OriginalGriff29-Dec-14 2:02
mveOriginalGriff29-Dec-14 2:02 

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.