[GRASS-dev] Tabs and spaces in C code

Glynn Clements glynn at gclements.plus.com
Fri Aug 22 04:10:15 PDT 2014

Moritz Lennert wrote:

> >> You need to have 8 spaces tabs for the files to look correct.
> >
> > So? Tabs *are* 8 columns. Just like pi = 3.14159..., c = 299792458 m/s,
> > etc. This isn't a matter of preference.
> I don't have any specific knowledge, and definitely no religion in this 
> debate, but according to [1] (and I have no idea how valid the author's 
> statements are), your point of view seems to be a bit *nix-centric.

It's not so much that my view is Unix-centric, as that the other
popular platforms (Windows, Mac) are rather more willing to discard
long-standing conventions (in some cases, this is meant to cause
problems, i.e. "embrace, extend, extinguish").

Historically, software and hardware which interpreted a tab character
fell into two categories:

1. Hard-coded (or hard-wired) at 8 columns.
2. Defaults to 8 columns, can be configured.

[Note that the Windows console appears to fall under #1; if there's a
way to change the tab width, I can't find it.]

The existence of software which defaults to something other than 8
columns is a relatively recent phenomenon. And it's not as if the
8-column convention will be going away any time soon (e.g. POSIX has
many such references, and is unlikely to make an incompatible change
based upon "fashion").

> In the idea of trying to get more developers for Windows, wouldn't
> it help to find a "standard" that applies across all platforms ?

There are only two possible standards: tabs are 8 columns, or they're
ambiguous and thus must be avoided.

It's not as if Windows editors can't be configured to use 8-column
tabs (given the amount of existing code that uses that convention,
that would harm Windows users, which isn't the intent).

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list