The rule is easy. (A) A tab character may only appear in cases where it is prefixed by one of these three notions: Start-of-file, another tab, or a new line. Anywhere else: Flag it.
(B) Spaces may not be prefixed by tabs or new lines or start-of-file (optional: unless they follow a number of tabs that represent the same indent (= number of tabs) as the previous line - if you really must line up things in tables in code. Usually I just say: Write a text file and read it in in a static block instead, if that's what you need). I also turn on visible whitespace in my editors (you see tabs, CRs, and spaces with very light gray symbols, instead of literally white space). As a result no mixed indent code is ever pushed into the repo. After about half a day with that on you stop getting distracted by it. Tabs for indents has a few advantages. The most important one is that anybody can change the tab stop size in their own editor to a size they are comfortable with. It cannot affect the indent flow if rule A and B are adhered to. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
