Click here to Skip to main content
12,820,283 members (30,081 online)
   

C#

 
AnswerRe: Tuples in Functions Pin
Keith Barrow18-Aug-12 10:38
mentorKeith Barrow18-Aug-12 10:38 
AnswerRe: Tuples in Functions Pin
BillWoodruff18-Aug-12 10:43
memberBillWoodruff18-Aug-12 10:43 
GeneralMy Vote of 5 Pin
Keith Barrow18-Aug-12 11:32
mentorKeith Barrow18-Aug-12 11:32 
GeneralRe: Tuples in Functions Pin
leppie18-Aug-12 22:37
memberleppie18-Aug-12 22:37 
While anonymous classes will not here, in this situation based on the amount of usage and 'decoration' required, a concrete class IMO would be a better option.

Remember you only have to write it once.

struct State
{
  public CheckState Value;
  public DateTime When;
  public string By;
  public decimal Amount;
}


A struct already implements hashcode and equality too.

Now imagine you need an extra field. In the case of a class/struct, no problem, but your Tuple will require changes across the board, even if you just add it to the end.

GeneralRe: Tuples in Functions Pin
BillWoodruff19-Aug-12 15:15
memberBillWoodruff19-Aug-12 15:15 
GeneralRe: Tuples in Functions Pin
leppie19-Aug-12 20:41
memberleppie19-Aug-12 20:41 
AnswerLeppie's interesting suggestion to use 'Anonymous Classes' ... Re: Tuples in Functions Pin
BillWoodruff18-Aug-12 16:49
memberBillWoodruff18-Aug-12 16:49 
GeneralRe: Leppie's interesting suggestion to use 'Anonymous Classes' ... Re: Tuples in Functions Pin
BobJanova20-Aug-12 2:00
memberBobJanova20-Aug-12 2:00 
QuestionTrying to Obtain Two (2) Values from Function Pin
computerpublic16-Aug-12 22:53
membercomputerpublic16-Aug-12 22:53 
AnswerRe: Trying to Obtain Two (2) Values from Function Pin
DaveyM6916-Aug-12 23:36
mentorDaveyM6916-Aug-12 23:36 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 25 Mar 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid