A suggestion for ending the spaces versus tabs discussion.

It’s that simple, and I use it since the 80s:

The following rules should silence all criticism of the two parties:

  • Use tabs for indenting at the beginning of the line only, never use spaces before the first non-space character in line. Indentation shall reflect the semantic layout of the source text.
  • Use spaces otherwise and for vertical aligned table layout in the rest of the line.
  • Never cross indentation levels when creating vertical, space aligned tables.

I don’t want to go into discussion about legacy display terminals or what should be stored in the revision control.

I consider the source the model and so it shall not be changed by personal preference or by any tool.

Following the above rules, ragged tables are avoided and indentation always represents the semantic structure of the source, independent of the tab-size the editor is configured with.

So, follow these rules and create great code.

yours armin