6

ME:
if
{
//statements
}

HIM:
if {
//statements
}

Comments
  • 9
    him > you.

    This is also something very trivial to argue over.
  • 1
    For me depends on the language you if it is PHP, C#, C++. Him if it is JS.

    Also if it is an if just to check something and if that is true I'll use;

    if (check)
    return;
  • 2
    I don’t really care and let my text editor do the job
  • 4
    @RicoNijeboer Leaving brackets off is fun until you get a bug because of it.
  • 3
    Allman style all the way. F**k vertical space!

    But seriously, if I'm working with more people I respect the commonly used style whatever it is, same as with spaces vs tabs. If it's my own code, my preference is always Allman style. It looks cleaner to me, it's more readable for me at a glance and offers a clear and proper separation of the code block from the block statement (or lack thereof).
  • 3
    Me:
    (a ?
    b
    :)
  • 1
    if(check) goto jmp;
    //something
    :jmp
    //statement
    goto end;
    :jmp0
    //other statement
    goto end;
    :end
  • 3
    (He’s right)
  • 5
    Him is better
  • 1
    Me: Stream.of((Runnable)(()->a)).filter(()->condition).forEach(Runnable::run);
  • 1
    Also: http://editorconfig.org (and random.org) to the rescue.
  • 0
    Also just bc i do ocaml now

    if a then begin b end
  • 2
    I prefer you
  • 0
    I minimize the code and win over you all.
  • 1
    @RicoNijeboer for me thats fine for return statements but why not just on one line? Makes it much clearer what your intention was. Also less likely to get bugs cause someone added a line
  • 1
    Thats not how tags work and his is better
  • 0
    @Alice You mean the one with the instant return or the one where the {} are on their own line?
  • 0
    @Alice where i work my MR gets denied if i don't 🤣
  • 0
    @Alice Hello, I am new here. Thanks for pointing it out. Ill correct it from next rant.
  • 2
    As long as it's consistent within the project, either is fine...

    But I prefer the first one.
Add Comment