• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Java/C#/C++/[insert language here] brackets

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
i prefer method 2, but i don't program in any such languages anymore. i like aligned brackets -- easier to find its start and finish.
 
Originally posted by: EyeMWing
Originally posted by: Auryg
2...just looks..cleaner.

Yeah, whenever I see code done with the bracket on the same line, I'm like "WTF kind of dirty linux user did this?"

haha, man...i should show some of the code that our sys admin wrote one day
 
#1 is the K&R style

if(true) {
...
}

#2 is the Berkeley (BSD) style

if(true)
{
...
}

IMO, #2 is MUCH cleaner.
 
Originally posted by: JustAnAverageGuy
if (x)
{

<indent>code here;

<indent><indent> {
<indent><indent><indent> code here;
<indent><indent><indent> code here;
<indent><indent> } while (y);

<indent> code here;

}

Like this 🙂


/Agree.

#2 w/ indentions here for me.
 
Originally posted by: dighn
2 for me. I'm just used to it because Visual Studio defaults to that style.

I don't remember exactly when I started...but that might have been the reason for me as well.
 
Back
Top