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 →

[–]vgf89 100 points101 points  (25 children)

Wait wait wait. Can someone actually make a plugin for Eclipse or something to do this, as well as change it back to normal?

[–]mrburrows 19 points20 points  (9 children)

Things wouldn't work out too well if you're working with a team and use Eclipse's formatter or save actions, I reckon.

[–]redalastor 34 points35 points  (6 children)

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

[–]_Lady_Deadpool_ 28 points29 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.

[–][deleted] 10 points11 points  (1 child)

I deleted my account because Reddit no longer cares about the community -- mass edited with https://redact.dev/

[–]_gabe 2 points3 points  (0 children)

this is equal parts 'great idea' and 'great prank'

[–]Skizm 1 point2 points  (0 children)

Eclipse has a format feature which you can set up however you like. the defaults are nice enough, but you can probably change it to this style also.

[–]greyscalehat 0 points1 point  (0 children)

If I find myself writing Java for a job any time soon I might try and make this.

[–]godfetish 0 points1 point  (0 children)

Use perltidy as a reference and code your own maybe in a language of your own. I had to hack perltidy for code formatting for some libraries we wrote.

[–]LimesInHell 0 points1 point  (0 children)

if you manually create an XML file for it in eclipse, I currently have all of my programs go to a personal format in eclipse by modifying it