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?
>>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.
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:
Anonymous2011-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.
>>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.
>>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!
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:
Anonymous2011-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?
>>38
Discussing the development of the following:
* Valeat Res Magis: FrozenVoid's Web Browser.
* /prog/OS: A revolutionary Common Lisp-based OS.
* Nordlige Project: A curtain fire shooting game featuring magical viking boys in the fantasy land of Asgard.
>>42
FV is worth taking just as seriously today as he had been years ago. On the other hand, he hasn't posted in years so I'm not sure what you're talking about.
Name:
Anonymous2011-10-18 1:08
class fuckOff // {
{
System.out.println("Is it really that big of a fucking deal");
>>61 yfw everything in lisp could be this clean but lisp must insist that EVERY FORM EVER be potentially variatic.
McCarthy designed Lisp as a backend for his Algol compiler. It was never intended to be used directly. So didnt cared about the amount of verbosity.
>>65 b, d and e have implicit begins.
In Scheme (but it's of course possible in CL too), (cond (e => f) ...) means (let ((x e)) (if x (f x) ...), cond's syntax permits extensions such as (cond (e => guard f) ...) -> (let ((x e)) (if (g x) (f x) ...). (cond a b c d e) can't be extended as easily as (cond (a b) (c d) (else e)) in a backwards compatible way.