Boost logo

Boost :

Subject: Re: [boost] coding conventions
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-01-04 10:09:40


On Mon, Jan 4, 2010 at 8:08 AM, OvermindDL1 <overminddl1_at_[hidden]> wrote:
> On Mon, Jan 4, 2010 at 7:27 AM, Stewart, Robert <Robert.Stewart_at_[hidden]> wrote:
>>> PS Using 2 space indentation reduces the risk of running over
>>> the 80 width, so is my preference.
>>
>> Some find two too small to visually align vertically, but four limits indentation depth, so we've used three for years.  (Gasp!  Yes, three isn't a power or multiple of two, but it works well.)
>
> I have always been curious about that.  To me it makes *no* sense to
> use spaces for indentation.  I always use tabs for indentation and
> spaces for alignment, my reasoning is that you can set tabs to be any
> size you want in your editor, one space if you wish even, and spaces
> for alignment just makes sense, for example:
> class myClass : public anotherClass
> {
> public:
>        float f_;
>
>        myClass(std::string s // assume we need to wrap due to being too long
>               ,float f) // aligned with spaces after being tabbed equal to
> the above line
>                :anotherClass(s) // indented with tabs
>                ,f_(f)
>        {
>                // do stuff, two tabs
>        }
> }

And of course the email client converted my tabs to 8 spaces, but you
get the idea...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk