Click here to Skip to main content
15,892,005 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: Code Reviews Pin
theoldfool12-Aug-20 3:07
professionaltheoldfool12-Aug-20 3:07 
GeneralRe: Code Reviews Pin
5teveH12-Aug-20 3:23
5teveH12-Aug-20 3:23 
GeneralRe: Code Reviews Pin
BDieser13-Aug-20 3:15
BDieser13-Aug-20 3:15 
GeneralRe: Code Reviews Pin
CHill6012-Aug-20 3:08
mveCHill6012-Aug-20 3:08 
GeneralRe: Code Reviews Pin
MarkTJohnson12-Aug-20 3:16
professionalMarkTJohnson12-Aug-20 3:16 
GeneralRe: Code Reviews Pin
5teveH12-Aug-20 3:22
5teveH12-Aug-20 3:22 
GeneralRe: Code Reviews Pin
Stefan_Lang13-Aug-20 0:00
Stefan_Lang13-Aug-20 0:00 
GeneralRe: Code Reviews Pin
PIEBALDconsult12-Aug-20 4:27
mvePIEBALDconsult12-Aug-20 4:27 
Absent a team style document, definitely stand your ground.
And certainly ignore weenies who try to quote from other teams' style documents. "But Microsoft says.." "We don't work for Microsoft, you weenie!"

I'm a whitespace supremicist as most of you know, so I nearly always use as much vertical space as I deem reasonable.
There are times, though, when I would use a series of one-liners. Usually if the tests and actions are very similar -- to show how they are similar.

C#
if ( TestX ) { DoX() } ;
if ( TestY ) { DoY() } ;
if ( TestZ ) { DoX() } ;
...


I feel that in this situation, this style leads to more readable/understandable code and that copy/paste errors like above may be more easily spotted.

Does the language you're using not allow:
{do something} if {condition}


VAX BASIC V3.9-000

Ready

10 LET X = 42
20 PRINT "yes" IF X = 42
runnh

yes
Ready


Laugh | :laugh:

modified 12-Aug-20 11:47am.

GeneralRe: Code Reviews Pin
5teveH12-Aug-20 5:25
5teveH12-Aug-20 5:25 
GeneralRe: Code Reviews Pin
Richard Andrew x6412-Aug-20 5:09
professionalRichard Andrew x6412-Aug-20 5:09 
GeneralRe: Code Reviews Pin
5teveH12-Aug-20 5:34
5teveH12-Aug-20 5:34 
GeneralRe: Code Reviews Pin
Richard Andrew x6412-Aug-20 5:55
professionalRichard Andrew x6412-Aug-20 5:55 
GeneralRe: Code Reviews Pin
Gerry Schmitz12-Aug-20 5:10
mveGerry Schmitz12-Aug-20 5:10 
GeneralRe: Code Reviews Pin
Stefan_Lang12-Aug-20 22:06
Stefan_Lang12-Aug-20 22:06 
GeneralRe: Code Reviews Pin
Gerry Schmitz13-Aug-20 19:15
mveGerry Schmitz13-Aug-20 19:15 
GeneralRe: Code Reviews Pin
iskSYS12-Aug-20 21:17
professionaliskSYS12-Aug-20 21:17 
GeneralRe: Code Reviews Pin
5teveH12-Aug-20 21:40
5teveH12-Aug-20 21:40 
GeneralRe: Code Reviews Pin
iskSYS13-Aug-20 21:18
professionaliskSYS13-Aug-20 21:18 
GeneralRe: Code Reviews Pin
Steve Owen12-Aug-20 21:30
Steve Owen12-Aug-20 21:30 
GeneralRe: Code Reviews Pin
Sander Rossel12-Aug-20 21:47
professionalSander Rossel12-Aug-20 21:47 
GeneralRe: Code Reviews Pin
RooN3y12-Aug-20 22:23
RooN3y12-Aug-20 22:23 
GeneralRe: Code Reviews Pin
Martin ISDN12-Aug-20 23:40
Martin ISDN12-Aug-20 23:40 
GeneralRe: Code Reviews Pin
Davyd McColl13-Aug-20 0:31
Davyd McColl13-Aug-20 0:31 
GeneralRe: Code Reviews Pin
Stefan_Lang13-Aug-20 21:23
Stefan_Lang13-Aug-20 21:23 
GeneralRe: Code Reviews Pin
Matt Bond13-Aug-20 1:52
Matt Bond13-Aug-20 1:52 

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.