Click here to Skip to main content
14,607,267 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: Tabs Pin
Fever9055-Mar-20 3:44
professionalFever9055-Mar-20 3:44 
GeneralRe: Tabs Pin
Stefan_Lang4-Mar-20 21:32
mveStefan_Lang4-Mar-20 21:32 
GeneralRe: Tabs Pin
KLSmith5-Mar-20 5:15
MemberKLSmith5-Mar-20 5:15 
GeneralRe: Tabs Pin
Kirk 103898216-Mar-20 3:59
MemberKirk 103898216-Mar-20 3:59 
GeneralRe: Tabs Pin
BillWoodruff3-Mar-20 22:29
mveBillWoodruff3-Mar-20 22:29 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 1:35
professionalGreg Utas4-Mar-20 1:35 
GeneralRe: Tabs Pin
W Balboos, GHB4-Mar-20 1:39
mveW Balboos, GHB4-Mar-20 1:39 
GeneralRe: Tabs Pin
Member 79891224-Mar-20 2:51
MemberMember 79891224-Mar-20 2:51 
I do not see why the inner "if" is indented 2*4 spaces. I think it should line up with the first comment.

Small sidetrack:
Your style of commenting the end brace to indicate what it terminates can be very helpful in complex code. But what I long back to is the CHILL style: Any block can be labeled (the label applies to the block, not to a point in the code). If you repeat the label after the closing brace, the compiler will check it, giving a compilation error if it doesn't match. You could also break out to any outer block level, referring to the block label. Like
Outerloop: if (true) {
    Innerloop: while (moreToDo) {
         // some thing here
         if (reasonToTerminate) exit Outerloop;
    } Innerloop;
} Outerloop;
This is far more readable and far safer. Unfortunately, it isn't straightforward to introduce it into the syntax of C class of languages. But as an emergency solution, your comments is a great alternative. Not necessarily for 2-line innermost loops/ifs, but certainly when the loop/if spans a dozen lines or more.
GeneralRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:08
mveW Balboos, GHB4-Mar-20 5:08 
GeneralRe: Tabs Pin
Member 79891224-Mar-20 12:25
MemberMember 79891224-Mar-20 12:25 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 2:54
mveRichard MacCutchan4-Mar-20 2:54 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 3:08
professionalGreg Utas4-Mar-20 3:08 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 3:34
mveRichard MacCutchan4-Mar-20 3:34 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 3:48
professionalGreg Utas4-Mar-20 3:48 
GeneralRe: Tabs Pin
FormerBIOSGuy6-Mar-20 10:47
MemberFormerBIOSGuy6-Mar-20 10:47 
GeneralRe: Tabs Pin
Greg Utas6-Mar-20 12:18
professionalGreg Utas6-Mar-20 12:18 
GeneralRe: Tabs Pin
Dan Neely4-Mar-20 3:30
MemberDan Neely4-Mar-20 3:30 
JokeRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:05
mveW Balboos, GHB4-Mar-20 5:05 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 5:14
mveRichard MacCutchan4-Mar-20 5:14 
GeneralRe: Tabs Pin
Stefan_Lang4-Mar-20 21:44
mveStefan_Lang4-Mar-20 21:44 
GeneralRe: Tabs Pin
W Balboos, GHB5-Mar-20 1:18
mveW Balboos, GHB5-Mar-20 1:18 
GeneralRe: Tabs Pin
englebart5-Mar-20 2:55
professionalenglebart5-Mar-20 2:55 
GeneralRe: Tabs Pin
agolddog5-Mar-20 4:13
Memberagolddog5-Mar-20 4:13 
GeneralRe: Tabs Pin
Bitbeisser5-Mar-20 7:18
MemberBitbeisser5-Mar-20 7:18 
GeneralRe: Tabs Pin
Navanax5-Mar-20 15:03
MemberNavanax5-Mar-20 15:03 

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.