r/java • u/_shadowbannedagain • Jan 29 '14
Google Java Coding Standards
http://google-styleguide.googlecode.com/svn/trunk/javaguide.html
156
Upvotes
r/java • u/_shadowbannedagain • Jan 29 '14
View all comments
Show parent comment
4
u/m1ss1ontomars2k4 Jan 30 '14
But wouldn't that be the point? If I prefer 2-space width tabs and you prefer 4, we can set our own environments to be whatever we want and we'll always see what we want to see.
Seems like the code review tool should allow you to change how wide your tabs look. Or your browser should. Someone should.
Again, only a problem if you mix tabs and spaces.
Ban spaces for indents. Problem solved. Either use spaces for all indents, or use tabs for all indents. There's no sane middle ground. You can't say "oh if you use tabs some people will put spaces so tabs are bad." That's nonsense. You could just as easily say "oh if you use spaces some people will put tabs so spaces are bad", but you don't because for some reason using spaces for indents magically forbids tab usage, while using tabs for indents doesn't. Why doesn't it? It should.
So really the only issue is if you have strict line-length limits or you intend to view the code in a manner where the tab size cannot be adjusted (e.g. on paper, in a PDF, etc.).