we may be talking at cross purposes as well as disagreeing. We also
may be starting to repeat ourselves. Editors and code layouts are very
personnel things.
ok. A <tab> character is ASCII 9 if found in source text (I know the
world isn't ASCII, but a bit of concreteness here makes life a little
easier). A <tab> is also a key on many keyboards. I'll try and
that is there are said:
And variable, to the individual coder's tastes, simply by their choice of
tab stops, without messing it up for everyone else. Yes, indeed, tab-
stop dependent, not "whatever number of spaces I think should be inserted
here" dependent.
one difficulty with embedded <tab-chars> as the only layout character
is that you lose fine control.
void pippo (int n)
{
if ((n == PHOTON) ||
(n == LEPTON) ||
(n == HADRON))
{
send_msg ("claim nobel!");
}
}
I don't see how this layout can survive spaceless layout or variable
tab stops. Presumably you don't require layout like this.
I have a better editor.
One that understands the difference between
spaces and tabs. One that does *not* do something as brain-dead as
deleting _multiple_ characters when I press delete once. Any editor
which deletes multiple items on a single delete simply cannot be trusted,
it's liable to destroy something.
no. My editor (this is actually a configurable option) only does this
for spaces. I assure you it works well in practice.
If I hit the <tab-key> it inserts N spaces. I still use the <tab-key>
to indicate layout but the editor puts said:
No, sorry, we're using spaces here, not tabs. If you want to insert
tabs, then by all means, use tabs.
If I want to insert <tab-chars> (eg. for the dreaded make file) I have
to change an option on my editor. Normally I do not want to insert
But then you're on my side of the
fence, with spaces being defective by design for indent.
this is phrasing it rather strongly. There are plenty of people who
have a different opinion from you.
If they weren't
defective by design, you wouldn't be using tab instead of space.
is that <tab-char> or <tab-key>?
<snip>
[it's getting repetitive]
If your editor - and the notion of spaces for indentation - weren't
defective by design, you wouldn't need to use a special key to insert
spaces; that's why you have a space bar. The fact you have to resort to
something entirely different, the tab key, is prima facie evidence the
whole notion of spaces to indent is as defective as it appears.
this is opinion masquerading as fact. I use the <tab-key> to indicate
my layout requirement; the editor "compiles" this into <space>
characters. A one-to-one mapping of key to text is not a requirement
(plainly not or delete and backspace would always work the way I
wanted them to on Unix!).
Now, if your editor worked properly, using tabs instead of spaces, with
the tab key inserting tabs as it should, then when viewed on someone
else's display, rather than yours, it would show the code as *they*
prefer to view it, rather than as *you* have decided is the only true way
which everyone should be forced to view it in.
I like finer control over my layout than you do apparently
Really, isn't this just a case of imposing your own layout conventions on
others, rather than using a common sense approach which actually lets
everyone view the code in their own preferred manner? Without having to
defeat the needless additional complication of converting some godawful
arrangement you happen to like into something actually manageable?
but you also require others to agree to your conventions.
I bet you'd hate this approach
Code laid out like this with 4 character indent
xxxx
yyyy
zzzz
wwww
and using S and T to represent the "layout charcaters" actually looked
like this
xxxx
SSSSyyyy
Tzzzz
TSSSSwwww
the worst or all possible worlds!