1

I am really not looking for ++, and I don't want to be lazy and not looking my question up in google, but I wanted to hear the community dicussions on where should we put the brackets :D (I am for the same line but all the lecturers in mh university want us to put it on the next :\)

Comments
  • 3
    As far as I'm concerned, for me, it's language-dependant.

    When I'm codign:

    - Java : Same Line
    - PHP : Next Line
    - C++ : Next Line
    + Python: Look mom, no brackets!
  • 3
    I put mine on the same line because I think putting it on the next is visually redundant; the scope starts at the indentation level of the declaration. You don't need to say it again with a bracket.

    I assume people put the bracket the next line to increase readability. I just add a blank line after the declaration if it's hard to read.
  • 0
    if you want some more action, gnu styling guide recommends writing the return type to a seperate line like:

    int
    my_function(int arg)
    {
    ...
    }

    i like philosophy and works of fsf but, just... why?
  • 2
    I'm a new line guy, but the Swift standard is same line and rest of the team want to stick to that, so i've had to sell my soul to the devil and become a same liner.

    I can see a noticeable difference in readability (negatively) from switching. I'm a fan of of breaking things up so its easier to scan.

    And I don't like trying to match one curly brace with the start of a function. For me its very painful to try match 2 unrelated symbols together, mentally its easier to match 2 curly's than 1 curly and an alpha.

    PS: theres also same liner's who put an empty new line afterwards. They are just anarchists who want to watch the world burn. No justification for that shit.
  • 0
    @practiseSafeHex i liked your post but i fear my judgement of ++'ing it might have been affected by your witty nickname.
  • 0
    @cors I think I'm ok with that either way
  • 1
    @DLMousey you may not use "this" in static methods.
  • 0
    Same line, every time. I hate when I'm reading code and the bracket gets its own line, just put a blank line in there and keep the bracket on the same line.
Add Comment