Click here to Skip to main content
15,606,811 members

Survey Results

"out" parameters: A good idea or a bad idea?

Survey period: 15 Jan 2018 to 22 Jan 2018

Given that it has its own Code Analysis warning we know where some people stand on this.

OptionVotes% 
They are a Good Thing1029.66
They are fine if used wisely43240.91
They are what they are15414.58
They should probably be avoided where possible20119.03
They should never be used. Ever.393.69
I have no idea.12812.12



 
GeneralI prefer to avoid them Pin
den2k8818-Jan-18 2:52
professionalden2k8818-Jan-18 2:52 
GeneralManipulating struct-arrays directly. Pin
Paulo Zemek17-Jan-18 8:19
Paulo Zemek17-Jan-18 8:19 
GeneralLike so many things.... Pin
Dominic Burford17-Jan-18 4:51
professionalDominic Burford17-Jan-18 4:51 
Answernot more than one ref- or out parameter Pin
sx200816-Jan-18 7:17
sx200816-Jan-18 7:17 
I would use not more than one reference or out parameter per function.
If there is a need for multiple ref- or out parameters this is a clear sign that there is a class missing:
C#
// wrong
private bool ReadCustomerData(int pkCustomer, out string CustomerCode, out string CustomerName, out CustType type)
{
}

// correct
private CustomerInfo ReadCustomerData(int pkCustomer)
{
}

// wrong
private void CleanupLine(ref string line)
{
}

// correct
private string CleanupLine(string line)
{
}

Generalno idea or opinion on the matter Pin
Dennis E White16-Jan-18 4:33
professionalDennis E White16-Jan-18 4:33 
GeneralThey are ok if you know what you are doing Pin
RugbyLeague15-Jan-18 21:08
RugbyLeague15-Jan-18 21:08 
GeneralRe: They are ok if you know what you are doing Pin
obermd16-Jan-18 4:39
obermd16-Jan-18 4:39 
GeneralRe: They are ok if you know what you are doing Pin
Foothill16-Jan-18 4:56
professionalFoothill16-Jan-18 4:56 
GeneralThey are what they are Pin
CPallini15-Jan-18 9:33
mveCPallini15-Jan-18 9:33 
GeneralRe: They are what they are Pin
Nemanja Trifunovic18-Jan-18 2:23
Nemanja Trifunovic18-Jan-18 2:23 
GeneralWith tuples, I think they are mostly unnecessary Pin
Marc Clifton15-Jan-18 7:07
mvaMarc Clifton15-Jan-18 7:07 
GeneralRe: With tuples, I think they are mostly unnecessary Pin
OriginalGriff15-Jan-18 11:20
mvaOriginalGriff15-Jan-18 11:20 
GeneralRe: With tuples, I think they are mostly unnecessary Pin
Richard Deeming16-Jan-18 3:48
mveRichard Deeming16-Jan-18 3:48 
GeneralRe: With tuples, I think they are mostly unnecessary Pin
Slacker00716-Jan-18 4:21
professionalSlacker00716-Jan-18 4:21 
GeneralRe: With tuples, I think they are mostly unnecessary Pin
Stuart Dootson16-Jan-18 1:12
professionalStuart Dootson16-Jan-18 1:12 
GeneralRe: With tuples, I think they are mostly unnecessary Pin
Mel Padden16-Jan-18 2:43
Mel Padden16-Jan-18 2:43 
GeneralThey are just fine, if used wisely Pin
Slacker00715-Jan-18 3:37
professionalSlacker00715-Jan-18 3:37 
GeneralRe: They are just fine, if used wisely Pin
peterchen15-Jan-18 4:46
peterchen15-Jan-18 4:46 
GeneralRe: They are just fine, if used wisely Pin
Espen Harlinn15-Jan-18 5:01
professionalEspen Harlinn15-Jan-18 5:01 
GeneralRe: They are just fine, if used wisely Pin
Dirk Bahle15-Jan-18 5:24
Dirk Bahle15-Jan-18 5:24 
GeneralRe: They are just fine, if used wisely Pin
peterchen15-Jan-18 5:32
peterchen15-Jan-18 5:32 
GeneralC# TryParse() Pin
PeejayAdams15-Jan-18 0:55
PeejayAdams15-Jan-18 0:55 
GeneralRe: C# TryParse() Pin
Slacker00715-Jan-18 3:33
professionalSlacker00715-Jan-18 3:33 
GeneralRe: C# TryParse() Pin
PeejayAdams15-Jan-18 4:33
PeejayAdams15-Jan-18 4:33 
GeneralRe: C# TryParse() Pin
11917640 Member 15-Jan-18 5:30
11917640 Member 15-Jan-18 5:30 

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.