Tell me you’re a Java developer without telling me you’re a Java developer.
I want a language that takes this and has a specification for the editor to prettify it
while x==y func1 func2
This is the way
Allman is a benign neurosis
oh so you hate Richard stallman?
Based
I quite like GNU
GNU style is logical, because braces are syntactically a single statement:
while (x == y) func1(); // can be replaced by { ... }
However, I prefer to entirely avoid unbraced single statements after while/if:
while (x == y) { func1(); // easy to add func2(); later }
Although this is ok when it fits:
while (x == y) func1(); // brevity!
Allman is objective the correct choice
On a serious note tho, I never understood the benefits of GNU’s spaces after functions. I don’t really mind most of the rest but I just don’t get the benefits of ‘funcname (arg)’ vs. ‘funcname(arg)’. Is there a specific reason for this? Personally, I find this to reduce readability because I have to think for a split second whether I’m looking at a variable or a function call.
Of cause this is also due to my habits, but I’m curious as to what the reasoning is.
Honestly I think it’s just “spaces before open parens” and at least it’s consistent. K&R, which I use, wants spaces before the parens in conditionals and loops but not in method sigs or method calls and the linter at work gets me almost every time I type the word “if”.
Allman is the only other one that has some sanity.
I use Allman for control statements and K&R for declarations
No line breaks. Just one long line of code.
All line breaks. Just one tower of code.
class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
why not
…
System
.out
.println(
"Hello,…
?
as always, c++ lets us do better in breathtakingly elegant fashion:
#\ i\ n\ c\ l\ u\ d\ e\ \ <\ i\ o\ s\ t\ r\ e\ a\ m\ >
finishing out hello world is left as an exercise to the reader, but the advantages and superior performance of this format should be obvious
I’ve seen some people who code like this
Allman is very practical for JSON
Allman is the way.
Allman all the way.
Allman makes the code look almost academic
Academic code is specifically created to be easily understood, so I’d agree.
Always Allman. Those others give you cancer
With all due respect, 🤮
Touché!
Allman or even horstmann I could still deal with, the rest would be difficult.
Though none are as bad as whoever came up with right aligning all the brackets to make any code look like python until you spot the deranged line of brackets on the right…
I cannot for the life of me find it now but the dude put it on GitHub
I found this from ~9 years ago on imgur, “A Python programmer attempting Java”
Haha ya that is probably it, looks great, just don’t read all the way to the right 😆
All of those are heretical. The one True Language is Brainfuck, where the coding syntax for Hello World is
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
If you have ADHD, your coding style is a combination of all of these, and sometimes none of the above.
For real, this is why I enable format on save.