Poll: Java Line Indentation

  • Flatline
  • 2 spaced
  • 4 spaced
  • 6 spaced
  • 8 spaced
  • Tab-Character

POLL EDIT: If you use the Tab Character for spacing, please specify what spacing you usually have that character emulate.

@FerusGrim shudders at tab-character

So, I’m curious! What spacing do you folks use, when indenting a new line?

Tab character would be better if the software all just used tab character and showed it in a customizable way. That way spacing is constant and controlled by implementation.

5 Likes

In a perfect world, the tab-character would be the best way to do anything, really.

I liked tabs until I realized that half the editors out there don’t actually conform to what the tab character is supposed to do >:|

2 Likes

@modwizcode
Could you update the poll to remove Tab Character? And add at the bottom:

“POLL EDIT: If you use the Tab Character for spacing, please specify what spacing you usually have that character emulate.”

EDIT: I’m asking, because I can’t modify the poll after five minutes. :smile:

I’m not a forum mod, @gratimax is though.

Thanks. :smile:

It is impossible to add/remove poll choices after the poll has been made. I just added the EDIT.

Oh, sorry. The popup that it throws when I attempt to change it tells me to contact a Moderator if I want it to be modified.

For me: Tab = 4 spaces

Tab, 4 spaces. c:

4 space tabs until i’m yelled at by my collaborators.

;D

2 Likes

4 spaces. I don’t like tabs because they don’t give me the customizability to use less indentation/appropriate indentation for different situations (consider multi-line function calls, where you want the initial period to be aligned with the period on the previous line, or other multi-line constructs). And I find the idea of mixing tabs and spaces abhorrent.

In your IDE just set tab formatting to two spaces, then you have the ability to control the space more finely and you don’t mix tab characters and space characters.

3 Likes

From what I know, if you give code to someone else that isn’t the way they format it, in Eclipse they can just right-click on code > Source > Format, and it’ll format it to their style.

1 Like

OK who voted for ‘Flatline’? (guess that means no indentation)
Madness…

2 Likes

what about the [] known as reverse indentation

    if(something)
        {
// do A
        }
    else
        {
// do B
    }

We don’t speak of reverse indentation, here.

4 Likes

Oh god… MY EYES!

3 Likes

am very tempted to submit source formatted for reverse indentation