Skip to main content
82 events
when toggle format what by license comment
Jun 2, 2022 at 8:22 history protected gnat
May 3, 2022 at 16:07 comment added KWallace FWIW, I like my closing brace to align under the command or keyword it is closing without anything in between. Follow the closing brace up, and the first keyword or command it meets is the thing it is closing.
Jan 10, 2022 at 4:12 comment added Liker777 I like the 3rd option (no braces on the separate line). However difficulties come when we want to cut and paste the whole line of code to somewhere else. Than instead of pressing fast keyboard shortcut selecting the whole line, we need to spend time on researching every bracket at the end of that line.
Jun 4, 2019 at 17:20 comment added Daniel Cumings I prefer braces on their own line for readability. I know people don't like the white-space, but to me being able to pick out beginning and end of brackets is more important than the extra lines that are gained from making it more compact. Also to be consistent I never assume implicit brackets.
Mar 28, 2019 at 21:23 comment added Somatic Custard en.wikipedia.org/wiki/Indentation_style contains names for the various styles, as well as more information, which I found useful to know.
Feb 20, 2019 at 6:06 comment added Chris Smith Coming from a visual studio background and learning Java now, I like the braces on their own line. I used these settings for IntelliJ superuser.com/a/1403486/75997
Dec 19, 2018 at 17:31 comment added Kirby the older i get the less whitespace i need
Aug 13, 2018 at 0:42 comment added Steve3p0 This is mostly just a preference. I don't have a strong opinion on it either way, other than to say people who put curly braces on the same line should be rounded up.
Oct 13, 2017 at 14:30 comment added Stevoisiak This really shouldn't have an accepted answer seeing as it is mostly up to user preference.
Dec 17, 2016 at 17:01 review Suggested edits
Dec 17, 2016 at 19:51
Feb 5, 2016 at 18:54 comment added Jules Answering just the title question: no. Curly braces are social animals, and don't like being left alone. If you have only one on a line, make sure you give it some friends: "int main () {{} ..."
Oct 29, 2015 at 23:36 comment added Phil D. I prefer the second and third methods for readability, though I'm not sure what the convention is when the condition breaks a line and is indented. Do you indent the parenthesis as well?
Mar 29, 2015 at 8:52 comment added Mints97 I heard that the second style was invented by low-profile coders who were paid per LoC... That could explain why it's the predominant style at Microsoft ;)
Sep 10, 2013 at 13:01 review Reopen votes
Sep 10, 2013 at 14:16
Sep 9, 2013 at 12:59 review Reopen votes
Sep 9, 2013 at 14:51
Jan 17, 2013 at 11:23 comment added Calmarius Anyway I prefer the second method. I have OCD, the lack of symmetry annoys me. ;P
Jan 17, 2013 at 10:10 comment added Calmarius Irony: "Please be constructive!" and "closed as not constructive"
Mar 16, 2012 at 10:05 comment added cnd sad the question is closed. After some time of indent based syntax usage I switched to (maybe weird) another braces structure. Like your first but closing brace in the last line of block. (after code line)
Feb 6, 2012 at 12:22 vote accept Tamara Wijsman
Feb 6, 2012 at 12:22 vote accept Tamara Wijsman
Feb 6, 2012 at 12:22
Sep 26, 2011 at 3:19 history closed Jeff Atwood not constructive
Sep 26, 2011 at 3:19 history notice removed Jeff Atwood
Sep 26, 2011 at 3:19 history unlocked Jeff Atwood
Sep 21, 2011 at 22:34 history unprotected user8
Sep 21, 2011 at 22:34 history notice added user8
Sep 21, 2011 at 22:34 history locked user8
Sep 21, 2011 at 22:34 history edited user8 CC BY-SA 3.0
deleted 222 characters in body; edited tags; edited title
Apr 6, 2011 at 14:51 history edited ChrisF CC BY-SA 2.5
moderator message
Apr 6, 2011 at 14:44 answer added Tim O'Neil timeline score: 5
Apr 6, 2011 at 14:43 answer added Alexander Gessler timeline score: 24
Apr 6, 2011 at 14:28 history protected ChrisF
Apr 6, 2011 at 14:14 comment added user22273 Whenever I get code from someone else that has the brackets barfed onto the ends of the if statement and tacked onto the last line of the block, the first thing I do is change it so that I can see what's happening. I get lazy sometimes when it is just one line and leave off the brackets altogether but I'm not proud of that fact.
Nov 6, 2010 at 7:56 comment added Christian Mann Honestly, aren't there tools for this sort of thing?
Nov 6, 2010 at 7:48 answer added Christian Mann timeline score: 9
Nov 5, 2010 at 18:49 answer added Matthieu M. timeline score: 17
Nov 5, 2010 at 17:38 answer added brian_d timeline score: -1
Nov 5, 2010 at 11:50 history bounty ended Tamara Wijsman
Nov 5, 2010 at 6:44 answer added dbza timeline score: 126
Nov 3, 2010 at 19:56 answer added OscarRyz timeline score: 5
Nov 3, 2010 at 4:19 answer added Digital Dude timeline score: 0
Nov 2, 2010 at 22:56 answer added llcf timeline score: -2
S Nov 2, 2010 at 20:52 answer added Toby timeline score: -1
S Nov 2, 2010 at 20:52 history made wiki Post Made Community Wiki
Nov 2, 2010 at 12:43 answer added Jonathan timeline score: 37
Nov 1, 2010 at 20:50 answer added JD Isaacks timeline score: 59
Nov 1, 2010 at 19:57 answer added user1842 timeline score: -2
Oct 30, 2010 at 5:54 answer added Joanis timeline score: 3
Oct 30, 2010 at 5:22 answer added DanLeaningphp timeline score: -3
Oct 30, 2010 at 2:47 answer added Mark Ransom timeline score: 44
Oct 30, 2010 at 0:56 history bounty started Tamara Wijsman
Oct 30, 2010 at 0:54 answer added bmb timeline score: 26
Oct 29, 2010 at 20:52 history edited Tamara Wijsman CC BY-SA 2.5
added 27 characters in body; edited tags; added 76 characters in body
Oct 29, 2010 at 19:21 history rollback Tamara Wijsman
Rollback to Revision 3
Oct 29, 2010 at 17:10 history edited user8
edited tags
Oct 29, 2010 at 17:09 answer added TRiG timeline score: 2
Oct 4, 2010 at 21:33 comment added jkerian Egyptian Brackets! stackoverflow.com/questions/2349378/…
Sep 29, 2010 at 19:15 comment added Shog9 @leeand00: oh yes. Doesn't matter how big your monitor is, it can't beat crawling over a conference-room floor covered in taped-together printouts with a Sharpie.
Sep 28, 2010 at 2:10 answer added AShelly timeline score: 0
Sep 27, 2010 at 10:31 vote accept Tamara Wijsman
Oct 30, 2010 at 1:10
Sep 27, 2010 at 4:43 answer added Stephen C timeline score: 127
Sep 27, 2010 at 0:20 comment added Shog9 @leeand00: some of us still print out complex / unfamiliar code in order to study / annotate it. A good pretty-printer mitigates most of the problems though.
Sep 26, 2010 at 23:51 comment added leeand00 The only reason this would matter would be if your IDE/editor doesn't support matching curly bracket recognition.
Sep 26, 2010 at 23:43 answer added jkerian timeline score: 6
Sep 22, 2010 at 22:03 answer added gablin timeline score: 3
Sep 21, 2010 at 3:59 comment added Moshe Excellent question. Can we get som esources as to where the different styles originated?
Sep 21, 2010 at 3:57 answer added Nayrb timeline score: 9
Sep 21, 2010 at 3:47 answer added Ming-Tang timeline score: 0
Sep 12, 2010 at 6:05 answer added Chankey Pathak timeline score: 0
Sep 12, 2010 at 3:10 answer added rhettg timeline score: 297
Sep 11, 2010 at 14:27 answer added AndrejaKo timeline score: 2
Sep 11, 2010 at 14:06 answer added ChrisF timeline score: 12
Sep 11, 2010 at 6:59 answer added P Shved timeline score: 47
Sep 11, 2010 at 5:06 answer added Phil Cohen timeline score: 2
Sep 11, 2010 at 4:40 answer added Jay Bazuzi timeline score: 239
Sep 11, 2010 at 4:29 answer added EpsilonVector timeline score: 83
Sep 11, 2010 at 4:14 answer added FeatureCreep timeline score: 5
Sep 11, 2010 at 1:06 answer added Mawg timeline score: 10
Sep 11, 2010 at 0:35 history edited Tamara Wijsman CC BY-SA 2.5
added 104 characters in body
Sep 10, 2010 at 23:24 answer added Ullallulloo timeline score: 6
Sep 10, 2010 at 23:09 answer added Robert Harvey timeline score: 21
Sep 10, 2010 at 22:39 history edited Tamara Wijsman CC BY-SA 2.5
Gone with the "== true"! :-)
Sep 10, 2010 at 22:15 history asked Tamara Wijsman CC BY-SA 2.5