January 29, 2012
Le 29/01/2012 12:36, Trass3r a écrit :
>> http://www.d-programming-language.org/dstyle.html in regard to
>> indent-style, can someone shed some light what is recommended practice
>> for it within D community?
>
> Everyone thinks his way is the best.

I would say that the most important is to be consistent accros a project or a code base. The style in itself, execpt for some special tricky case doesn't change a lot.
January 29, 2012
> Personally, I've never understood how anyone can stand anything other than Allman.

Totally agree.
January 29, 2012
On Sunday, 29 January 2012 at 14:42:16 UTC, Daniel Murphy wrote:
> http://media.comicvine.com/uploads/6/67698/1595201-oh_look_its_this_thread_again_super.jpg

That's nothing. If you want to see a truly great bikeshedding thread, go there:
http://www.reddit.com/r/programming/comments/p1j1c/tabs_vs_spaces_vs_both/
January 29, 2012
> Am I mistaken? If no, am I missing some major spaces advantages? If no, lets use tabs. Perhaps, there is no tool that will convert (convert right, not somehow, see article) tabs<->spaces in D code.

There wouldn't be any problem if people were able to use tabs for indentation and spaces for alignment, i.e. in cases like
if (cond1 &&
   cond2)

But people are dumb and many project leaders "take no risks" and require spaces everywhere instead of doing it properly.

An ever better solution is elastic tabstops, but unfortunately no major editor supports that.
January 29, 2012
Am 29.01.2012 16:23, schrieb Trass3r:
> But people are dumb and many project leaders "take no risks" and require
> spaces everywhere instead of doing it properly.
>
> An ever better solution is elastic tabstops, but unfortunately no major
> editor supports that.

Where's the problem, you can configure most editors to insert N-spaces when pressing the tab-key. Some editors are so smart enough to handle the N-spaces still as tabs but save them as spaces.
January 29, 2012
Le 29/01/2012 16:39, David a écrit :
> Am 29.01.2012 16:23, schrieb Trass3r:
>> But people are dumb and many project leaders "take no risks" and require
>> spaces everywhere instead of doing it properly.
>>
>> An ever better solution is elastic tabstops, but unfortunately no major
>> editor supports that.
>
> Where's the problem, you can configure most editors to insert N-spaces
> when pressing the tab-key. Some editors are so smart enough to handle
> the N-spaces still as tabs but save them as spaces.

So, the point is saving spaces and programing many many tricks in the editor to make spaces behave like tabs.

I don't see the point of it. It is just like you were asking for a 4 wheeled motobike with a roof and 5 sits because you don't want a car.
January 29, 2012
On 29/01/2012 14:17, bearophile wrote:
> Denis Shelomovskij:
>
>> Am I mistaken? If no, am I missing some major spaces advantages? If no,
>> lets use tabs.
>
> D2 style guide should *require* D2 to be edited using a mono-spaced
> font, and the D2 front-end should enforce this with a "-ms" compiler switch.

What do you mean by the "D2 front-end"?  The compiler front-end, or some IDE?

If you're talking about the compiler, how will it determine what font was set in the program used to edit the file?  Are you planning to make this work even if the file has been edited in more than one editor and/or font over the course of time?

If you mean an IDE, what use would a compiler switch be?  Just set up the font selection UI to allow only monospaced fonts to be selected.  In Windows at least, the font common dialog has a flag to do this.

Stewart.
January 29, 2012
Stewart Gordon:

> What do you mean by the "D2 front-end"?

It was one of my first attempts at humor :-)

Bye and sorry,
bearophile
January 29, 2012
On 29/01/2012 14:17, bearophile wrote:
> Denis Shelomovskij:
>
>> Am I mistaken? If no, am I missing some major spaces advantages? If no,
>> lets use tabs.
>
> D2 style guide should *require* D2 to be edited using a mono-spaced
> font, and the D2 front-end should enforce this with a "-ms" compiler switch.

What do you mean by the "D2 front-end"?  The compiler front-end, or some IDE?

If you're talking about the compiler, how will it determine what font was set in the program used to edit the file?  Are you planning to make this work even if the file has been edited in more than one editor and/or font over the course of time?

If you mean an IDE, what use would a compiler switch be?  Just set up the font selection UI to allow only monospaced fonts to be selected.  In Windows at least, the font common dialog has a flag to do this.

Stewart.
January 29, 2012
deadalnix wrote:

> I would say that the most important is to be consistent accros a project

If it is indead important, then the project shoud have a tool that can enforce that style. And every coder should have a tool that enforces her/his indiviuell style, if she/he cannot cope with that style.

Ever heard of any one having such a tool?

-manfred