[Israel.pm] Tabs vs. Spaces

Yuval Yaari yuval at windax.com
Sat Jun 12 10:55:41 PDT 2004


Mikhael Goikhman said:
> Yuval, please try stay on topic. We are at "tabs vus spaces", not at
> "smart vus dumb" editors here. These are orthogonal issues, at least in
> theory.

Ok - you're right.
Change it to "smart tabs" and "dumb tabs" where possible.

> People choose the first 2 policies I described because they care about
> other developers and they are not interested in the religious battles
> about which indention is better, 3, 5 or 8 columns.

While it might be true, I wouldn't work with a style I don't find
comfortable.
A company-style could still be tab-width specific, too.
Same for project-styles, whatever.

True, not 100% of the world would like the way it looks.
But well, that's what I think about print $indent_level x "\t", $line;
[That is, lines indented by tabs only].
It's readable, basically, but it's not as convinient as if things are
aligned.

> You believe your editor is configurable. I thought so too many years
> ago. It is not. Try to configure CPerl mode in it to follow the first
> policy. Then configure it to follow the second. It should be perfect
> without any single glitch, the result should be viewable with any tab
> size. Ask any additional questions in private, discussing editors is
> totally offtopic.

Ok, just FYI - CPerl mode can use the indention styles that I hate and it
looks good in any editors with any tab size.
Yes, I checked. I tested on a few editors with different tab sizes.

It is possible that it is a new feature, I didn't use it "many years ago".

Back to the discussion, though:
Let's assume I choose the style where things vertically align with...
other things...
I'm trying to think of a way to make it cross-editor ;)

I do understand why people indent with tabs only.
I just don't like the way it looks...
And, just to add some objective reasons: you still should have funny
results when placing tabs in the middle of lines (when vertically aligning
comments or something), so you will have "glitches" in this style too.

Generally, if your company style mentions a tab-size (and it would, I
guess), why not use the style where everything aligns?
This way it's not prone to "glitches" (unless you don't care much about
company styles and `perltidy` your code before putting it on CVS?).

Not trying to argue about personal preferences, but I just might change my
style and I want to understand what might be the best choice.


  --Yuval





More information about the Perl mailing list