Click here to Skip to main content
15,922,007 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get cell values in devexpress gridcontrol via a function Pin
Richard MacCutchan28-Jun-13 23:16
mveRichard MacCutchan28-Jun-13 23:16 
GeneralRe: How to get cell values in devexpress gridcontrol via a function Pin
Member 253280030-Jun-13 15:29
Member 253280030-Jun-13 15:29 
GeneralRe: How to get cell values in devexpress gridcontrol via a function Pin
Member 253280030-Jun-13 18:03
Member 253280030-Jun-13 18:03 
GeneralRe: How to get cell values in devexpress gridcontrol via a function Pin
Richard MacCutchan30-Jun-13 21:19
mveRichard MacCutchan30-Jun-13 21:19 
QuestionGrid Based Games Pin
Midnight Ahri28-Jun-13 1:34
Midnight Ahri28-Jun-13 1:34 
AnswerRe: Grid Based Games Pin
Pete O'Hanlon28-Jun-13 2:22
mvePete O'Hanlon28-Jun-13 2:22 
GeneralRe: Grid Based Games Pin
Midnight Ahri28-Jun-13 6:23
Midnight Ahri28-Jun-13 6:23 
AnswerRe: Grid Based Games Pin
Emmanuel Medina28-Jun-13 9:03
professionalEmmanuel Medina28-Jun-13 9:03 
Question[RESOLVED] Regular Expressions Problem Pin
Sonhospa27-Jun-13 23:13
Sonhospa27-Jun-13 23:13 
AnswerRe: Regular Expressions Problem Pin
Eddy Vluggen28-Jun-13 1:53
professionalEddy Vluggen28-Jun-13 1:53 
GeneralRe: Regular Expressions Problem Pin
Sonhospa28-Jun-13 2:43
Sonhospa28-Jun-13 2:43 
GeneralRe: Regular Expressions Problem Pin
Eddy Vluggen28-Jun-13 6:28
professionalEddy Vluggen28-Jun-13 6:28 
AnswerRe: Regular Expressions Problem Pin
Richard MacCutchan28-Jun-13 2:22
mveRichard MacCutchan28-Jun-13 2:22 
GeneralRe: Regular Expressions Problem Pin
Sonhospa28-Jun-13 2:48
Sonhospa28-Jun-13 2:48 
GeneralRe: Regular Expressions Problem Pin
Richard MacCutchan28-Jun-13 3:00
mveRichard MacCutchan28-Jun-13 3:00 
GeneralRe: Regular Expressions Problem Pin
Sonhospa28-Jun-13 3:17
Sonhospa28-Jun-13 3:17 
GeneralRe: Regular Expressions Problem Pin
Richard MacCutchan28-Jun-13 3:30
mveRichard MacCutchan28-Jun-13 3:30 
QuestionWord Object Error Pin
bganesan27-Jun-13 22:18
bganesan27-Jun-13 22:18 
QuestionRe: Word Object Error Pin
ZurdoDev28-Jun-13 9:43
professionalZurdoDev28-Jun-13 9:43 
Questionhelp button and f1 key error Pin
User349027-Jun-13 22:09
User349027-Jun-13 22:09 
QuestionControling a scroll bar for Remote Desktop Pin
Andre O Rahming27-Jun-13 7:42
Andre O Rahming27-Jun-13 7:42 
QuestionC# desktop type ahead Pin
dcof27-Jun-13 6:35
dcof27-Jun-13 6:35 
AnswerRe: C# desktop type ahead Pin
Ron Beyer27-Jun-13 6:49
professionalRon Beyer27-Jun-13 6:49 
QuestionParanoid Question of the Day Pin
Keith Barrow27-Jun-13 3:50
professionalKeith Barrow27-Jun-13 3:50 
C#
public void Foo(Bar bar)
{
    if (bar== null)
    {
        bar = new Bar();
    }
    //Do something with bar;
}


--- or ---

C#
public void Foo(Bar bar)
{
    bar = bar ? new Bar();
    //Do something with bar;
}


Which do you think is better?

[Edit]
Thanks all for your help. I opted for 1 (it was the original code so I know it'll make it through the code review) and easier for newer devs to understand. I might drop the {}.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed”
“One of the greatest problems of our time is that many are schooled but few are educated”


Sir Thomas More (1478 – 1535)


modified 28-Jun-13 9:22am.

AnswerRe: Paranoid Question of the Day Pin
PIEBALDconsult27-Jun-13 3:56
mvePIEBALDconsult27-Jun-13 3:56 

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.