Open freerider7777 opened 10 months ago
Maybe because of
increased consistency across all repos, so contributing to other projects feels familiar
Source: https://github.com/palantir/palantir-java-format#upsides-of-automatic-formatting
Some interesting links:
four spaces should be used as the unit of indentation -- Java Code Conventions, 1997, Sun Microsystems, https://www.oracle.com/technetwork/java/codeconventions-150003.pdf
Another accessibility reason for tabs: when using a braille display, each space takes up one character cell, so indenting with four spaces eats up four cells. Indenting three times with four spaces each eats up 12 characters already. Tabs only take one character cell each, so three indents = three character cells used.
Given many, if not most, braille displays are 40 cells long, and that 70-to 80-cell displays are considered a luxury, and you can see how cutting 12 space characters down to 3 tab characters could be really, really helpful.
Nevertheless, I think, it's hard to change the Java codestyle rule of 1997.
@koppor Thanks for the links. But as there are options as GOOGLE/PALANTIR/AOSP - why not make it configurable :)) We have corporate code style - so we need to recompile such plugins...
Can we support options for maxLength and spaces length ?
GOOGLE is good that is has 2 spaces (but 100 max length), PALANTIR is good that it has 120 length (but 4 spaces) - why not add 120 length with 2 spaces?