Click here to Skip to main content
15,888,287 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
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 
i don't know about documented coding standards, but i frequently use one liner if, for, if-else and even for-if.

for me, when working in a lower level language, they represent some alternative to higher level constructs.

one liner if and for it that scenario, at least for me, are not equivalent to branching and looping. the are equivalent to something that in JavaScript would represent Array.map(), Array.every(), Array.some()...

for (condition) if (condition) expression;

in C if-else is not well suited for a one liner, because if and else are separated by a semicolon.

but in Pascal, they go swell.

if (condition) then expression1 else expression2;

on the other hand, whenever i use if as a logical condition for branching (in old books represented as rhombus with arrows going left or right), i always create a new block at a new line.
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 
GeneralRe: Code Reviews Pin
Stuart Dootson13-Aug-20 2:06
professionalStuart Dootson13-Aug-20 2:06 
GeneralRe: Code Reviews Pin
loctrice13-Aug-20 3:32
professionalloctrice13-Aug-20 3:32 
GeneralRe: Code Reviews Pin
hpcoder213-Aug-20 13:43
hpcoder213-Aug-20 13:43 
GeneralGrowth by shrinkage? Pin
Sander Rossel12-Aug-20 0:11
professionalSander Rossel12-Aug-20 0:11 
GeneralRe: Growth by shrinkage? Pin
Sandeep Mewara12-Aug-20 0:37
mveSandeep Mewara12-Aug-20 0:37 
GeneralRe: Growth by shrinkage? Pin
musefan12-Aug-20 0:38
musefan12-Aug-20 0:38 
GeneralRe: Growth by shrinkage? Pin
GenJerDan12-Aug-20 0:44
GenJerDan12-Aug-20 0:44 
GeneralRe: Growth by shrinkage? Pin
W Balboos, GHB12-Aug-20 0:52
W Balboos, GHB12-Aug-20 0:52 
GeneralRe: Growth by shrinkage? Pin
Nelek12-Aug-20 2:57
protectorNelek12-Aug-20 2:57 
GeneralRe: Growth by shrinkage? Pin
kmoorevs12-Aug-20 4:39
kmoorevs12-Aug-20 4:39 
GeneralRe: Growth by shrinkage? Pin
CodeWraith12-Aug-20 0:57
CodeWraith12-Aug-20 0:57 
GeneralRe: Growth by shrinkage? Pin
Jörgen Andersson12-Aug-20 1:27
professionalJörgen Andersson12-Aug-20 1:27 
GeneralRe: Growth by shrinkage? Pin
Sander Rossel12-Aug-20 2:14
professionalSander Rossel12-Aug-20 2:14 
GeneralRe: Growth by shrinkage? Pin
Jörgen Andersson12-Aug-20 2:16
professionalJörgen Andersson12-Aug-20 2:16 

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.