June 15, 2004
"Regan Heath" <regan@netwin.co.nz> wrote in message news:opr9lt690b5a2sq9@digitalmars.com...
> On Sun, 13 Jun 2004 23:34:15 -0700, Walter <newshound@digitalmars.com> wrote:
> > "Regan Heath" <regan@netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9@digitalmars.com...
> >> What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it.
> >
> > Despite most programmers mixing the two (including me), your technique
> > only
> > works for leading tabs. Using tabs to line up, say, right hand comments
> > (a
> > common style) fails even if you eshew spaces.
>
> You've got me backwards.. I specifically said I use spaces to line things up.

Ok, my mistake.


June 15, 2004
On Tue, 15 Jun 2004 11:54:28 +0100, Stewart Gordon <smjg_1998@yahoo.com> wrote:
> Regan Heath wrote:
>
> <snip>
>>> 2. Spaces only
>>> Pros:
>>> - consistent display
>>> - some editors can auto-convert tabs to spaces, making this form easy to produce
>>
>> or anyone can, trivially, with a small program.
>
> Well, there are plenty of programs out there that aren't small.  D is supposed to be suited to million-line projects according to the docs.

I think you have missunderstood. What I mean't here was that even if your editor couldn't convert it (tabs to spaces), you could write an app to do it for you. Thus you could produce an all spaces form easily.

>>> - layout preserved in situations where tab chars may not be transmitted/rendered properly
>>> Cons:
>>> - take up more disk space
>>> - tedious to type in primitive editors (e.g. Notepad)
>>> - harder to maintain by others who prefer tabs, if their tab width is different (e.g. two-space indentation seems to tend to come out of Emacs users....)
>>>
>>> 3. Tabs with space half-indentation
>>> Pros:
>>> - finer, more 'comfortable' indentation than some tab width hard-coded in certain contexts
>>
>> do you mean "in an editor with hard coded tabstops of 8 spaces it looks nicer than tabs does"?
>
> Yes.  But also situations where code is merely displayed and/or transmitted, rather than edited, under the same constraint.

True. This is Walters main argument for this tab/space style I believe.

>>> - less tedious than all-space indenting in Notepad
>>
>> this is also a con, if you re-word it as..
>>  - slightly more tedious than all-tab indenting in notepad.
>>
>>> - slightly more compact on disk than all-space indenting
>>
>> this is also a con, if you re-word it as..
>>  - slightly less compact on disk than all-tab indenting.
>
> Yes, I was kind of thinking that myself.  I guess that, on average, the number of spaces would outweigh the halving of the number of tab characters....
>
> <snip>
>> It's important to nore that if "tabs only" is used it does not mean you cannot use spaces where you want/need to. I do this in msdev to align specific things like comments on columns to a static array of data etc. They stay aligned regardless of the tabstop as I do not mix spaces and tabs in doing it.
> <snip>
>
> Yes, there's giving code a tabular layout.  And boxed comments.  Not to mention my tendency to indent subsequent lines of a statement by 2 spaces.

This would be my preffered coding style also.

Regan.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
June 19, 2004
After reading the posts in this thread, I've come to the only logical conclusion one can make.  You guys need better recreational pharmaceuticals.

BA


The Dr ... who? wrote:
> Walter
> 
> I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITA when
> viewed with any other tools whose default tabs are not 8, or which have been set
> to another tab setting.
> 
> Is there a good reason why you (and anyone writing for Phobos) can't change to
> just spaces only?
> 
> 
> 
1 2 3 4 5
Next ›   Last »