[OT] Spaces/tabs (Was: simple display (from: GUI library for D))

Nick Sabalausky a at a.a
Mon Apr 11 13:09:43 PDT 2011


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.3371.1302508910.4748.digitalmars-d at puremagic.com...
>> Jonathan M Davis Wrote:
>> > Personally, I think that it's _horrible_ to use tabs
>>
>> Why would one fear tabs?
>
> They change depending on your editor settings. Indenting gets screwed up 
> if
> tabs and spaces are mixed. It's just plain annoying to have an indentation 
> of
> multiple spaces which isn't actually multiple spaces.
>
> The biggest problem though is that it just totally screws with indentation 
> if
> tabs and spaces are mixed and that invariably happens.
>

You're drawing a completely invalid conclusion from that, because it works 
the same both ways. If I have a bunch of code indented with spaces, all it 
takes is a few things to be indented with tabs instead to create the *exact 
same screwup*. You've chosen tabs as the villian completely arbitrarily.

Also I find your argument that the mixup is significantly more likely when 
tabs are used for indentation to be extremely questionable. You admit 
yourself that you've rarely come across situations where tabs are the 
default. So how would you know? Based on that *one* piece of anecdotal 
evidence? And even that can be suspect, because if you were involved, we 
know you're accustomed to using spaces for indentation, so that could very 
well have been the reason for the mixup.

I have worked with code that used spaces as indentation on various 
occasions, and I always did wind up accidentally sticking some tabs in 
there. So I know first hand that the idea of the mixups not happening with 
space-indentation is a load of crap. They're equally likely.

And as far as needing to use spaces in code anyway: That's not remotely a 
problem. People know damn well the difference between a space and 
indentation. Fuck, if MS Word users can figure it out, so can programmers.

> Tabs serve no useful purpose IMHO.
>

Well, IMO, using spaces for indentation serves no useful purpose. At least 
tabs actually *mean* alignment and indentation. Spaces don't and never have. 
Plus, what's the use of being able place the cursor at arbtrary points 
within the "4 spaces" (or 8 spaces, or whatever)? All it does is make me 
have to press left/right-arrow-key a whole hell of a lot more (which I 
really do find to be a PITA). And makes it easier to accidentally end up 
with a messed up indentation of +/- 1 space somewhere. Spaces for 
indentation is just a misuse and a kludge to force on each other the 
idiologies of how large indentation should be.





More information about the Digitalmars-d mailing list