Click here to Skip to main content
15,887,135 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: Curly braces Pin
PIEBALDconsult12-Dec-22 2:42
mvePIEBALDconsult12-Dec-22 2:42 
GeneralRe: Curly braces Pin
Sanjay K. Gupta12-Dec-22 2:54
professionalSanjay K. Gupta12-Dec-22 2:54 
GeneralRe: Curly braces Pin
Jörgen Andersson12-Dec-22 2:56
professionalJörgen Andersson12-Dec-22 2:56 
GeneralRe: Curly braces Pin
den2k8812-Dec-22 3:04
professionalden2k8812-Dec-22 3:04 
GeneralRe: Curly braces Pin
Nelek12-Dec-22 4:05
protectorNelek12-Dec-22 4:05 
GeneralRe: Curly braces Pin
Single Step Debugger12-Dec-22 4:05
Single Step Debugger12-Dec-22 4:05 
GeneralRe: Curly braces Pin
Nelek12-Dec-22 4:06
protectorNelek12-Dec-22 4:06 
GeneralRe: Curly braces Pin
godfetish12-Dec-22 4:08
godfetish12-Dec-22 4:08 
The only sane format is:
void Afunc()
{
}

Why #1:
Because half the non-curly scoped languages out there use words or other symbols for marking scope, and BEGIN just doesn't look right at the end of the line!
Why #2:
Java version 1.1 (the first language I used and learned that trailed the curly brace in books) was so horrible, it gave me one more thing to hate!
Why #3:
Other than using some automated reformatting that kicks lines to the right or left, I find it very difficult to find missing curly braces in some logic. Matched ones line up very clearly. If they trail the line, when things get a few indents deep, the code becomes hard to read and finding that one line you inserted outside of them takes more time than just begin clear the first time. So, always on its own line!
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

GeneralRe: Curly braces Pin
k505412-Dec-22 5:02
mvek505412-Dec-22 5:02 
GeneralRe: Curly braces Pin
trønderen12-Dec-22 5:14
trønderen12-Dec-22 5:14 
GeneralRe: Curly braces Pin
Amarnath S12-Dec-22 4:48
professionalAmarnath S12-Dec-22 4:48 
GeneralRe: Curly braces Pin
den2k8812-Dec-22 4:54
professionalden2k8812-Dec-22 4:54 
GeneralRe: Curly braces Pin
trønderen12-Dec-22 5:17
trønderen12-Dec-22 5:17 
GeneralRe: Curly braces Pin
Single Step Debugger12-Dec-22 4:58
Single Step Debugger12-Dec-22 4:58 
GeneralRe: Curly braces Pin
Gerry Schmitz12-Dec-22 6:08
mveGerry Schmitz12-Dec-22 6:08 
GeneralRe: Curly braces Pin
Gary R. Wheeler12-Dec-22 13:13
Gary R. Wheeler12-Dec-22 13:13 
GeneralRe: Curly braces Pin
Jeremy Falcon14-Dec-22 12:16
professionalJeremy Falcon14-Dec-22 12:16 
GeneralRe: Curly braces Pin
Gary R. Wheeler24-Dec-22 9:13
Gary R. Wheeler24-Dec-22 9:13 
GeneralRe: Curly braces Pin
BernardIE531713-Dec-22 4:28
BernardIE531713-Dec-22 4:28 
GeneralRe: Curly braces Pin
Jeremy Falcon14-Dec-22 12:14
professionalJeremy Falcon14-Dec-22 12:14 
GeneralWSO CCC OTD 2022-12-12 Pin
OriginalGriff11-Dec-22 21:32
mveOriginalGriff11-Dec-22 21:32 
GeneralRe: WSO CCC OTD 2022-12-12 Pin
pkfox11-Dec-22 21:35
professionalpkfox11-Dec-22 21:35 
GeneralRe: WSO CCC OTD 2022-12-12 Pin
OriginalGriff11-Dec-22 21:54
mveOriginalGriff11-Dec-22 21:54 
GeneralRe: WSO CCC OTD 2022-12-12 Pin
pkfox11-Dec-22 22:15
professionalpkfox11-Dec-22 22:15 
GeneralRe: WSO CCC OTD 2022-12-12 - we have a winner! Pin
OriginalGriff11-Dec-22 22:25
mveOriginalGriff11-Dec-22 22:25 

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.