Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Brace Style/Position

Name: Anonymous 2011-10-15 6:05

Java convention states:

Open brace “{” appears at the end of the same line as the declaration statement.
The opening brace should be at the end of the line that begins the compound statement; the
closing brace should begin a line and be indented to the beginning of the compound
statement.

>Like this

public class Zelda {
   //statements
}

>NOT LIKE THIS

public class Zelda
{
   //statements
}

Fuck people, put the opening brace on the same line as declaration statement. Is it really so hard?

Source: http://www.oracle.com/technetwork/java/codeconventions-150003.pdf

Name: Anonymous 2011-10-15 6:07

green text fail

but true, opening braces should go on the same line

Name: Anonymous 2011-10-15 7:54

As if any 14 year old would read a paper with 24 pages or even care about it. Get real.

Name: Anonymous 2011-10-15 9:11

>>2
There is no green text on /prog/. Go back to imageboards.

Name: Anonymous 2011-10-15 10:40

'>O RLY

Name: Anonymous 2011-10-15 10:44

>>5
open("shit.txt", O_RLY)

Because C has no symbols.

Name: HAXUS THE GREAT 2011-10-15 11:59

>>1
I don't /prog/gram in fucking Java, so fuck your "like this" convention.
I prefer the "NOT LIKE THIS" way since its easy by far to fucking SEE where the opening an closing curly braces are, especially with vim's syntax highlighter.

Name: Anonymous 2011-10-15 16:36

>>7
No, its not proper.

Name: Anonymous 2011-10-15 16:57

Name: Anonymous 2011-10-15 16:59

>>9
hi reddit!

Name: Anonymous 2011-10-15 17:29

>>9
go back to reddit fag

>>1
+1 for opening brace on same line

Name: Anonymous 2011-10-15 17:37

I prefer the "not like this" version, because the extra whitespace emphasizes the structure. Classes are things, not statements.

It's 2011. We don't have to be on 80x24; screens are as close to paper as they've ever been. Thus, understanding and implementing the principles of typography helps everyone, especially when writing in such a potent shorthand, where one glyph of punctuation  could destroy the entire work.

Name: Anonymous 2011-10-15 19:03

I hate the half-on-half-off style. If you're going to put { on the same line, you should put } on the same line too.


public class Zelda {
  public void start() {
    doSomething(); } }


but that's ugly as fuck. So the only way to be both pretty and consistent is to put every { and } on its own line.

Name: Anonymous 2011-10-15 19:19

>>13

public class Zelda {
   public void start(){
      doSomething();
   }
}

Name: Anonymous 2011-10-15 19:20

>>14
fail

Name: Anonymous 2011-10-15 19:27

public class Zelda
{
public void start()
{
doSomething();
}
}

Name: sage 2011-10-15 19:46


public
class
Zelda
{
public
void
start()
{
doSomething(
);
}
}

Name: Anonymous 2011-10-15 20:00

>>17
no

Name: Anonymous 2011-10-15 20:00

>>16-17

this is not pythonic

Name: Anonymous 2011-10-15 22:57

>>13
Lisper detected.

>>12
The extra whitespace makes it easy to "get lost" in the code for me. It's like those people who post on forums with 1 sentence per line. I use only enough whitespace to make the limits of a block clear.

Name: Anonymous 2011-10-16 5:33

>>7
Nope.avi

Name: Anonymous 2011-10-16 9:02

--> This thread is shitty and all, but check'em dubz.

Name: Anonymous 2011-10-16 9:04

I use braces doggy style

Name: Anonymous 2011-10-16 23:28

>>20
I concur.

Name: Anonymous 2011-10-17 0:04

>>20
What's that? Is that some Rice-A-Roni between your cheeks?!?
Therefore, all of your arguments are completely incorrect, and I am the number one winner right this minuteness!

Name: Anonymous 2011-10-17 0:11

>>20
Lisper detected.

OH NO HE'S FIGURED OUT MY SECRET

god this board is shitty

Name: HAXUS THE GREAT 2011-10-17 0:38

>>26
god this board is shitty
Please leave and never return. Thanks!
- The Management -

Name: Anonymous 2011-10-17 0:45

>>27
hax my anus, onee-chan faggot

Name: Anonymous 2011-10-17 0:51

>>27
- The Management -
You're not MrVacBob-sama.

Name: Anonymous 2011-10-17 1:00

When you put the open brace on the same line as declaration, it sometimes promotes code sandwiching. The code will cascade into each other and it will look like slop.

I think both styles have the pros & cons though. Too much spacing makes your head dizzy.

Name: Anonymous 2011-10-17 1:09

If I wanted to weave another kilobyte of core then I'd put whitespace in my code. But really, why bother?

Name: Anonymous 2011-10-17 1:26

>>30-31
sage you shit posts, ``faggots''

Name: Anonymous 2011-10-17 1:29

>>31
Go back to sleep die, Frozenvoid.

Name: Anonymous 2011-10-17 5:15

>>33
FrozenVoid doesn't sleep() or die() thats defective Sepples-level shit.

Name: Anonymous 2011-10-17 8:38

>>21
yourmomsafaggotbecausesheboreachildwhocantjusttypeanormalresponseandinsteadstypesitoutasafilename.swf

Name: Anonymous 2011-10-17 8:39

Please try to ignore troll posts.

Name: Anonymous 2011-10-17 12:10

statement (input)
 {
    Code
 }
is The Right Way.

Name: Anonymous 2011-10-17 14:06

>>36
Then what's the point of this board?

Name: Anonymous 2011-10-17 14:22

public class Zelda{public void start(){doSomething();}}

Name: Anonymous 2011-10-17 14:27

>>38
Getting dubz.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List