lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GOP-PROP 3: C++ formatting


From: Hans Aberg
Subject: Re: GOP-PROP 3: C++ formatting
Date: Wed, 22 Jun 2011 11:31:25 +0200

On 22 Jun 2011, at 01:30, Graham Percival wrote:

> ** Eliminate tabs
> 
> I’m going to make the bold step of assuming that we will eliminate
> tabs in all C++ files. I personally like the idea of tabs, but
> from an examination of source code styles (both official and
> unofficial) in various projects, I must admit that this ship has
> sailed. Too many programs/editors don’t support tabs. Too many
> people find them confusing. Too many cut&paste jobs from html
> results in spaces instead of tabs.

Tabs have the problem that there is no standard on their display width. So one 
cannot rely on the editor displaying as intended when typing.

The preference on UNIX-like platforms was 8 spaces, which is too much for code 
with more than just a few indentation levels. Some prefer 4 spaces instead, but 
that is also a bit too much.

So 2 spaces work perfectly fine to express indentation. Modern editors intended 
for writing code can replace the tabs with whatever one wants, but if one 
happens to not have those, 2 spaces is simple to type by hand.

That is what was decided on the Bison lists, and it is now the GNU coding 
standard:
  http://en.wikipedia.org/wiki/Indent_style#GNU_style
And your first link uses that too. So it is used by some projects.

Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]