Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-09 09:16:16

From: "Terje Slettebø" <tslettebo_at_[hidden]>
> The following have probably been covered before, but I didn't find a
> rationale for it here ( Why are
> tabs banned in Boost libraries?

Its roughly the same reasons as we format for fixed-width fonts.

> If you use tabs for indentation, and spaces for alignment, there
> be any problem with it. Tabs have an advantage over spaces in that it
> then show the source using the tab spacing that you prefer, and it would
> still be aligned correctly.

Yes, but few editors give you tools for helping you with that, or for
checking that you actually use that practice:

    ^I^Itypedef typename some_template<^I// This is the beginning of a
    ^I^I^Isome_param1, some_param2^I^I// really long comment which is
    ^I>::type some_type;^I^I^I^I// supposed to appear aligned in the source

> Other advantages are:
> - They tell logically what it's about, while spaces carry no such
> information.


> - It only takes the space of one character in the file, rather than N
> characters.

Disks are big. Memory is cheap.

> - This makes it also faster to cursor through it, as it jumps in steps of
> Some editors have the possibility to "cursor through tabs" (treat them as
> spaces, for cursor movement), but I haven't seen any that are able to
> through spaces", :) i.e. jump in groups of N, at the right places.

Emacs can do anything.

           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at