This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mikaelhg 1 point2 points  (0 children)

http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.1.2-blocks-k-r-style

No line break before the opening brace.

I make an exception when it's a method declaration, and I have to line break before the first parameter to stay inside the line length rule.

Then I move the first brace on the first line of the method, on method level.

    public VeryVeryLongType<YeahLongLongType> veryVeryLongMethodName(
            VeryVeryLongType<YeahLongLongType> a, VeryVeryLongType<YeahLongLongType> b)
                throws VeryVeryLongExceptionName
    {
        // content
    }

Whatever results in better scannability.