>Tabs aren't used to saved bytes. They are used to save time. It is
>amazing to me that anyone uses spaces in their IDE. I cannot fathom
>dealing with the frustration of how long it takes to merely move the
>cursor through spaces. (The only solution is to use Ctrl + arrow
>keys, and for people who use that (I don't), I guess tabs or spaces
>are fine, either way, so yeah, go with spaces).
> Precisely. Of course you don't move through spaces just with the
> arrow keys -- that's what all those powerful cursor movement commands
> are for! Besides, Visual Studio usually auto-positions the cursor at
> the first non-blank character anyway, so it's not that often that you
> have to move through spaces at all. Certainly not an issue for me.
You should need unusual shortcuts to make an issue not an issue. Just
solve the issue, and then it works for people who don't use the
unusual shortcuts, as well.
It is an issue for me. One example is when I uncomment text, as I've
explained. The text is just 4 spaces away. Do you use Ctrl+right
arrow? or press right arrow once? I use right arrow. I bet people
who use Ctrl+arrows would do the same. Then, they are going through
spaces. It's annoying, and it does bite people. With tabs, there are
no such issues.
> >Tabs also just seem
> >proper. It's a distinct indentation. Spaces are just a guess.
[quoted text clipped - 4 lines]
> an IDE has 4 spaces per tab he'd use two tabs per indentation. Or
> maybe four tabs if the IDE is set to XML/HTML mode with 2 spaces/tab!
Not nonsense. I highly doubt any single person on this planet uses
more than 1 tab for indentation. We all consistently use 1. If not
all, the extreme vast majority. It's the old decrepit editors that
make it bad but not adhering to any standard for how large to make
them. On the other hand, look at spaces... 2, 3, 4, 5, 8, and who
knows how many others? Completely inconsistent.
> Also, people could use any number of spaces per tab. I take it you've
> never seen those C# code formatting guidelines where someone seriously
> recommended three spaces per indendation level? What about XML and
> HTML files which are usually indented with two spaces? Are you going
> to alternate between tabs and spaces for each level, or are you going
> to change the number of spaces per tab between file types?
I'm talking about source code. Not XML or HTML. Source code. All
source code. One tab.
Only when using spaces do you have the issue of dealing with how many
you should use. I understand why people use them, to avoid issues
between multiple editors, but for a lot of people, they don't deal
with such things. I'm not writing code to be put on a webpage. I'm
writing in VS. Fortunately, I needn't worry about using spaces
because of people using anticated editors, so I use tabs, and all of
these space issues vanish. (Except when VS puts spaces in when I
asked it not to, which is my sole concern today.)
> And if you wonder why I'm bringing this up -- think ASP.NET and XAML.
> That's a mix of HTML and XML, respectively, with embedded C# code. Are
> you going to switch tab sizes in the middle of a file, depending on
> the cursor position?
Again, I am talking about programming in an IDE, not publishing code.
Yes, I am fortunate to not have to worry about those issues. If I
did, then I'd probably try and use a consistent standard with them.
Unfortunately, that breaks down the benefits of tabs, for a better
benefit. Since, I just use my IDE, I am not going to use a worse idea
(and require Ctrl+arrow to move through 4 spces when i could use arrow
once) just because other people are unfortunately needing to embed
code meant to be written in an IDE into something else because they
wish to share it.
I agree spaces are best for portability. But, that's not an issue for
most people. I would suggest such displays of code outside of the
editor be improved anyway. They should covert tabs into spaces as
needed when it is pasted it. (When people copy and paste it back into
their own IDEs, it'd convert it back to tabs.) Look at the number of
webpages showing monochromatic code. They should have coloring. They
are just an incomplete solution to a problem, but the best available
so far, so people try to ease the issues uses spaces, making their IDE
editing worse in the process. I feel for them.
> >It's unfortunate that a proper
> >tab size isn't standardized, but i think it is within (recent) IDEs.
>
> You are quite wrong about that. Tab sizes differ between file types,
> and programmers will change tab sizes anyway if they don't like them.
> There's no such thing as a tab standardization.
I think the de facto is 4. I'd be surprised if any major IDE uses
otherwise. And even if that were the case, I'd love to see the
%ages. I bet 99%+ use 4. If that's not de facto, I don't know what
would be. Besides, the number of spaces can be changed, as you said,
to suit the programmer. I could use a different font, and increase it
to 6 or 7 since the space is smaller than in courier. With tabs, none
of this is an issue, since the code on another IDE that uses tabs is
displayed in the same format.
Spaces are only for portability for decrepit systems, or systems not
meant to display code. I feel for people who need to use them.
Luckily, I don't. Let's move ahead instead of being held back:
http://nickgravgaard.com/elastictabstops/
(amazingly great read)
Otherwise, we'll never improve.
Zytan