Click here to Skip to main content
15,895,709 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
OriginalGriff17-Feb-19 22:49
mveOriginalGriff17-Feb-19 22:49 
GeneralRe: Multiple returns from methods or clean code flow Pin
megaadam18-Feb-19 2:29
professionalmegaadam18-Feb-19 2:29 
GeneralRe: Multiple returns from methods or clean code flow Pin
André Pereira18-Feb-19 4:42
André 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
lopatir15-Feb-19 6:18 
GeneralRe: Multiple returns from methods or clean code flow Pin
André Pereira18-Feb-19 4:46
André Pereira18-Feb-19 4:46 
GeneralRe: Multiple returns from methods or clean code flow Pin
lopatir19-Feb-19 1:39
lopatir19-Feb-19 1:39 
AnswerRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 7:05
CodeWraith15-Feb-19 7:05 
Simply do it how you think it's ok. As long as it's only a question of preferences, I see no salomonian compromise.

Why?

Let's assume you can keep the method short and to the point, with only few conditions that 'spaghettify' the code. In that case I hope that all people involved are intelligent enough to read the code, despite it not having their preferred format.

In the other case, hopefully rare, where you have no choice and the method gets a little longer and has many if/else conditions, then religiously trying to put it in a certain format will most probably 'spaghettify' it even more and make it even harder to understand.

That's why I always prefer good judgement over religiously (meaning thoughtlessly) enforcing 'standards' at all cost. Whose standards? Those of the team as a common ground or those of a few beaurocrats who never find an end?

Been there, done that. I was once in charge of writing the 'rulebook' and code review. It kept getting longer every week. Rules, more rules, exceptions to the rules and then of course alternate rules. In the end it was always one or two people who turned the code review into a discussion about their personal preferences while the rest of the team started to ignore the whole worthless circus and automatically getting the buerocrats off their backs by giving them so much to freak out about that even they could not keep up with inventing more 'standards'. If those idiots want someone to type exactly what they want, why don't they get themselves a secretary?
I have lived with several Zen masters - all of them were cats.

His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

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
professionalZurdoDev15-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
professionalZurdoDev15-Feb-19 8:12 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 8:16
CodeWraith15-Feb-19 8:16 
GeneralRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 8:18
professionalZurdoDev15-Feb-19 8:18 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 8:51
CodeWraith15-Feb-19 8:51 
GeneralRe: Multiple returns from methods or clean code flow Pin
ZurdoDev15-Feb-19 9:03
professionalZurdoDev15-Feb-19 9:03 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith15-Feb-19 9:47
CodeWraith15-Feb-19 9:47 
GeneralRe: Multiple returns from methods or clean code flow Pin
kalberts17-Feb-19 22:02
kalberts17-Feb-19 22:02 
GeneralRe: Multiple returns from methods or clean code flow Pin
Mark_Wallace15-Feb-19 10:33
Mark_Wallace15-Feb-19 10:33 
GeneralRe: Multiple returns from methods or clean code flow Pin
CodeWraith17-Feb-19 22:48
CodeWraith17-Feb-19 22:48 
GeneralRe: Multiple returns from methods or clean code flow Pin
Mark_Wallace18-Feb-19 6:52
Mark_Wallace18-Feb-19 6:52 
AnswerRe: Multiple returns from methods or clean code flow Pin
MarkTJohnson15-Feb-19 8:16
professionalMarkTJohnson15-Feb-19 8:16 
AnswerRe: Multiple returns from methods or clean code flow Pin
Maximilien15-Feb-19 8:17
Maximilien15-Feb-19 8:17 
GeneralRe: Multiple returns from methods or clean code flow Pin
  Forogar  15-Feb-19 8:24
professional  Forogar  15-Feb-19 8:24 
QuestionRe: Multiple returns from methods or clean code flow Pin
megaadam17-Feb-19 22:23
professionalmegaadam17-Feb-19 22:23 

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.