[bind10-dev] [bikeshed] C++ indentation style

Michal 'vorner' Vaner michal.vaner at nic.cz
Sat Feb 5 10:09:54 UTC 2011


Hello

On Thu, Feb 03, 2011 at 11:47:48AM -0800, JINMEI Tatuya / 神明達哉 wrote:
>  - style #2 uses the space more efficiently (style #1 tends to require
>    large redundant spaces in the left side, which can lead to
>    unnecessarily longer lines)

Not longer lines. It happens in our code a lot, that after the indentation there
is a column of the width about 10 characters, which requires the statement be
many lines long. It is both highly unaesthetic and hard to read, not to mention
that less code is fit into the screen, having worse overview.

So, I agree about the #2 be more space efficient, but not that it would be about
the length of lines.

>  - (ditto) style #2 is (reportedly?) more friendly with vi

I don't know. I have it configured like so for some time already. But I guess
both can be accomplished by some variable setting (at last in vim, I'm not sure
about the old-fashioned vi).

If it wasn't clear from above, I vote for #2 (or, I use a really minor
modification ‒ same as when we have multiline function header, the { is on
separate line, I do the same with if and other statements, both to improve
readability ‒ it is more visible, where the condition ends and the body starts ‒
and more consistent with the functions).

I can try to adapt to other style, if there's a consensus, but #1 feels
unnatural to me.

Have a nice day

-- 
I have a theory that it's impossible to prove anything, but I can't prove it.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20110205/faa60150/attachment.bin>


More information about the bind10-dev mailing list