30.01.2012 0:49, Walter Bright пишет:
On 1/29/2012 6:04 AM, Denis Shelomovskij wrote:
Why does Phobos use 4-space indentation?

Because it works, changing it would be a vast waste of time for a
non-existent benefit, and it would become a nuisance to do diffs of
source code that cross the re-whitespace boundary.

The style for Phobos is 4 space indentation, no tab characters anywhere,
and LF line endings (to make github happy).

OK, the major advantage of spaces is because my approach (tabs for indention, spaces for alignment) isn't testable by a tool that doesn't know D semantics. More than that, my approach isn't a full solution too. It's outdated like spaces because of elastic tabstops. By the way, elastic tabstops looks easy auto-testable too so once we will just migrate to it (I hope).

But the current situation is still unpleasant because:
* There are no suggestions of using some tools for developers to automate conversion, so there is already a wasting of our time (developers and commit reviewers/mergers).
* Look's like nobody ever tested Phobos files for tabs.

P.S.
I started this thread because of wasting my time for conversion/checking and inconsistent situation: druntime/Phobos have both spaces/tabs now (yes, there are significantly more spaces, but it doesn't reduce the problem), e.g. you just broke formatting in std/stream.d:
https://github.com/D-Programming-Language/phobos/commit/f3aa58592faed9a418e347090cd614670947fef4

Reply via email to