Click here to Skip to main content
14,601,581 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: Multiple returns from methods or clean code flow Pin
OriginalGriff15-Feb-19 6:11
mveOriginalGriff15-Feb-19 6:11 
GeneralRe: Multiple returns from methods or clean code flow Pin
Jörgen Andersson15-Feb-19 6:13
professionalJörgen Andersson15-Feb-19 6:13 
GeneralRe: Multiple returns from methods or clean code flow Pin
Jon McKee15-Feb-19 15:24
professionalJon McKee15-Feb-19 15:24 
AnswerRe: Multiple returns from methods or clean code flow Pin
OriginalGriff15-Feb-19 6:10
mveOriginalGriff15-Feb-19 6:10 
GeneralRe: Multiple returns from methods or clean code flow Pin
Jörgen Andersson15-Feb-19 6:15
professionalJörgen Andersson15-Feb-19 6:15 
GeneralRe: Multiple returns from methods or clean code flow Pin
"mega"-in-a-fresh-shave!17-Feb-19 22:15
professional"mega"-in-a-fresh-shave!17-Feb-19 22:15 
GeneralRe: Multiple returns from methods or clean code flow Pin
OriginalGriff17-Feb-19 22:49
mveOriginalGriff17-Feb-19 22:49 
GeneralRe: Multiple returns from methods or clean code flow Pin
"mega"-in-a-fresh-shave!18-Feb-19 2:29
professional"mega"-in-a-fresh-shave!18-Feb-19 2:29 
I have been brainwashed to NEVER do:
if (a)
   b;

I think the preference is a matter of taste. I don't find either alternative more "consistent". "Consistent" depends on how you define that word (and the words "relevant code"). When skimming over large blocks of code the braces are - for my eyes - easier to find Allman style.

And the b; is very slightly easier on my eye in your Allman example. My guess is that we prefer what we were exposed to when we started walking... coding...
"If we don't change direction, we'll end up where we're going"

GeneralRe: Multiple returns from methods or clean code flow Pin
André Pereira18-Feb-19 4:42
MemberAndré Pereira18-Feb-19 4:42 
GeneralRe: Multiple returns from methods or clean code flow Pin
milo-xml18-Feb-19 1:47
professionalmilo-xml18-Feb-19 1:47 
AnswerRe: Multiple returns from methods or clean code flow Pin
lopatir15-Feb-19 6:18
Memberlopatir15-Feb-19 6:18 
GeneralRe: Multiple returns from methods or clean code flow Pin
André Pereira18-Feb-19 4:46
MemberAndré Pereira18-Feb-19 4:46 
GeneralRe: Multiple returns from methods or clean code flow Pin
lopatir19-Feb-19 1:39
Memberlopatir19-Feb-19 1:39 
AnswerRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 7:05
MemberCodeWraith15-Feb-19 7:05 
AnswerRe: Multiple returns from methods or clean code flow Pin
Gerry Schmitz15-Feb-19 7:33
mveGerry Schmitz15-Feb-19 7:33 
AnswerRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 7:50
mveZurdoDev15-Feb-19 7:50 
GeneralRe: Multiple returns from methods or clean code flow Pin
Gerry Schmitz15-Feb-19 8:08
mveGerry Schmitz15-Feb-19 8:08 
GeneralRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 8:12
mveZurdoDev15-Feb-19 8:12 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 8:16
MemberCodeWraith15-Feb-19 8:16 
GeneralRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 8:18
mveZurdoDev15-Feb-19 8:18 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 8:51
MemberCodeWraith15-Feb-19 8:51 
GeneralRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 9:03
mveZurdoDev15-Feb-19 9:03 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 9:47
MemberCodeWraith15-Feb-19 9:47 
GeneralRe: Multiple returns from methods or clean code flow Pin
Member 798912217-Feb-19 22:02
MemberMember 798912217-Feb-19 22:02 
GeneralRe: Multiple returns from methods or clean code flow Pin
Mark_Wallace15-Feb-19 10:33
MemberMark_Wallace15-Feb-19 10:33 

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.