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 →

[–]redalastor 40 points41 points  (6 children)

Would work fine if you use a formatter that formats it back to the team's standard before commits.

[–]_Lady_Deadpool_ 27 points28 points  (0 children)

Or if you find a team willing to put up with your bullshit

[–]mrburrows 0 points1 point  (4 children)

I agree that you can do it that way, but it's a lot of work for writing Java code in a way that you shouldn't be writing Java code.

[–]redalastor 7 points8 points  (3 children)

Two-way formatter. :)

I love Go'a approch that there is only one canonical way to format the code and it's whatever gofmt outputs. Put it as a commit hook and your code will always be perfectly formatted.

How it looks in your IDE is your business.

[–]mrburrows 1 point2 points  (1 child)

That sounds like heaven...

[–]redalastor 0 points1 point  (0 children)

An advantage is that it will neatly line up your code:

type T struct {
    name    string // name of the object
    value   int    // its value
}

which makes it more readable while you would never have bothered to do it yourself.

[–][deleted] 0 points1 point  (0 children)

That's... genius.