|
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 (http://www.boost.org/more/lib_guide.htm). Why are
> tabs banned in Boost libraries?
Its roughly the same reasons as we format for fixed-width fonts.
http://www.boost.org/more/lib_guide.htm#code%20fonts
> If you use tabs for indentation, and spaces for alignment, there
shouldn't
> be any problem with it. Tabs have an advantage over spaces in that it
would
> 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.
Huh?
> - 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
N.
> 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
"tab
> through spaces", :) i.e. jump in groups of N, at the right places.
Emacs can do anything.
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk