ANN: Dao Language v.0.9.6-beta is release!

S

Sybren Stuvel

D H enlightened us with:
How is that a problem that some editors use 8 columns for tabs and
others use less? So what?

I don't care either. I always use tabs, and my code is always
readable. Some people suggest one indents with four spaces, and
replaces eight spaces of indenting with a tab. Now _that_ is
irritating, since my editor's tab size is set to 4.
Tabs are easier to type (one keystroke each)

That depends on your editor. Mine (vim) can be instructed to insert
the appropriate amount of spaces on a tab, and remove them on a
backspace.

Sybren
 
E

Ed Leafe

They appear in different positions on different terminals (older hard-
copy),

Is anyone still using such devices to program Python?
do different things on different OS's,

Such as? I use OS X, Windows and Linux daily, and tabs work just
fine on all of those. Which OS is it that is aberrant, and how
exactly does it pose a problem?
and in general do not behave nicely.

Again, specifics would be welcome. I've been using tabs for
indentation for over a decade, and have not once run into the horror
stories that everyone who hates tabs says will happen, but who never
give specifics as to how they cause "problems".

If you want to use spaces, great. I'm certainly not going to
make up reasons why spaces are bad, just to make me feel better about
my preference. Just don't make general damning comments without any
specifics to back them up.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
 
E

Ed Leafe

That depends on your editor. Mine (vim) can be instructed to insert
the appropriate amount of spaces on a tab, and remove them on a
backspace.

So let's say that you are using 4 spaces as your standard, but
by accident type 5. You hit backspace, which deletes 4 spaces, and
you now have to mentally compute the difference in order to keep
things aligned.

See, I can make up bizarre scenarios where spaces cause
problems, too.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
 
R

Roel Schroeven

Dave said:
It's far more interesting to me _why_ people think indentation scoping
is a bad thing. The answer I get back fall into two general
categories: 1) I've heard/read/been told it's a bad thing, and 2) It
causes portability problems.

I can tell you why it freightened me at first: it made me think of the
rigid formatting of Fortran 77 and to a lesser extent BASIC. But when I
started working my way trough the tutorial, that fear very rapidly vanished.
 
S

Sybren Stuvel

Björn Lindström enlightened us with:

To me it doesn't. I use a single tab character for a single indent
levell. That is unambiguous, and also ensures the file is indented as
the reader likes it. People who have their tab size set to 'n' will
see n-space sized indents,

No matter what setting, the order of the indents is kept. This is not
the case if tabs and spaces are intermixed, as some style guides
suggest.

Sybren
 
F

Fredrik Lundh

Ed said:
So let's say that you are using 4 spaces as your standard, but
by accident type 5. You hit backspace, which deletes 4 spaces, and
you now have to mentally compute the difference in order to keep
things aligned.

See, I can make up bizarre scenarios where spaces cause
problems, too.

what's bizarre is that you're using an editor that don't understand how
blocks work in the language you're editing.

(in good python editor, tab means "move to next indentation level"
and backspace over a "virtual tab" means "move to previous indentation
level". if indentation is represented by spaces or tabs or both in the
resulting file is a serialization issue...)

</F>
 
J

JohnBMudd

This is amazing.

Python could take over the programming world except one of it's best
features (scope by indent) is a primary reason why it never will. It's
not flexible enough. A large percentage of programmers won't even try
the language.

And even amongst Python enthusiast who appreciate the feature (me
included) we can't agree on how to use it. Python is too flexible.

And nobody else sees the need for change? Oh, except those who think
Tabs are evil and should no longer be allowed.

How about (1) add some more flexibility for optional braces and (2) add
a formatting tool so I can reformat Python code to the "correct" style?
Python is just a program, not a religion. Unless... Tabs really are
evil.

John
 
F

Fredrik Lundh

Python could take over the programming world except one of it's best
features (scope by indent) is a primary reason why it never will. It's
not flexible enough. A large percentage of programmers won't even try
the language.

you're about 10 years late for this kind of trolling.

</F>
 
J

JohnBMudd

you're about 10 years late

The same could be said for hoping that the GIL will be eliminated.
Utterly hopeless.

Until... there was PyPy. Maybe now it's not so hopeless.
 
B

Benji York

Ed said:
So let's say that you are using 4 spaces as your standard, but
by accident type 5. You hit backspace, which deletes 4 spaces,

Nope, it would delete a single space. Then an additional backspace
would delete the 4.
See, I can make up bizarre scenarios where spaces cause
problems, too.

Only if you don't know how decent editors behave. :)
 
L

Lee Harr

No matter what setting, the order of the indents is kept. This is not
the case if tabs and spaces are intermixed, as some style guides
suggest.


I have never seen anyone suggest mixing tabs and spaces, and I
have read a lot of tabs-vs-spaces flamewars in my time.

Everyone agrees that mixing is bad. I might even go so far as to
say that the only real problem is mixing. The question is, if we
are trying to pick only one, which one causes fewer problems.

For me, it is spaces.

(oh, and unix line endings ;o)
 
P

Peter Decker

Everyone agrees that mixing is bad. I might even go so far as to
say that the only real problem is mixing. The question is, if we
are trying to pick only one, which one causes fewer problems.

For me, it is spaces.

Why is it that the only people who complain about this issue, and who
act all religious and self-righteous about it, are the ones who prefer
spaces?

I never cared one way or the other; I just used spaces because it
seemed that everyone else did. I recently switched to tabs because I'm
working a lot in Dabo, and they use tabs as their standard. But I must
say that listening to the space-zealots here has turned me off to
their arguments. My rule-of-thumb is that people only resort to such
zealotry when they have nothing better to offer. I've *never* seen any
of the problems they cite, and I hate to say how long I've been
around.
 
P

Peter Decker

But the same is also true of tabs causing problems :).

I'm starting to suspect that the same people who are zealous about
spaces are also the same people who look down on anyone who doesn't
agree with their choice of text editor.
 
B

Benji York

Peter said:
I'm starting to suspect that the same people who are zealous about
spaces are also the same people who look down on anyone who doesn't
agree with their choice of text editor.

Perhaps. As far as editor choice goes, I'm only fervent about people
picking a good editor (equivalent to Vim or Emacs) and learning it well.
Other than that I don't care. I'm not as diplomatic about tabs. :)
 
T

Tom Anderson


Ah, Jamie Zawinski, that well-known fount of sane and reasonable ideas.

It seems to me that the tabs-vs-spaces thing is really about who controls
the indentation: with spaces, it's the writer, and with tabs, it's the
reader. Does that match up with people's attitudes? Is it the case that
the space cadets want to control how their code looks to others, and the
tabulators want to control how others' code looks to them?

I wonder if there's a further correlation between preferring spaces to
tabs and the GPL to the BSDL ...

tom

Lexicographical PS: 'tabophobia' is, apparently, fear of the
neurodegenerative disorder tabes dorsalis.
 
T

Tom Anderson

The same could be said for hoping that the GIL will be eliminated.
Utterly hopeless.

Until... there was PyPy. Maybe now it's not so hopeless.

No - structuring by indentation and the global lock are entirely different
kettles of fish. The lock is an implementation detail, not part of the
language, and barely even perceptible to users; indeed, Jython and
IronPython, i assume, don't even have one. Structuring by indentation, on
the other hand, is a part of the language, and a very fundamental one, at
that. Python without structuring by indentation *is not* python.

Which is not to say that it's a bad idea - if it really is scaring off
potential converts, then a dumbed-down dialect of python which uses curly
brackets and semicolons might be a useful evangelical tool.

tom
 
S

Steven D'Aprano

Björn Lindström said:


Not even *close* to explaining it. The author doesn't
mention a single problem that happens because of using
tabs. He doesn't even try to explain what Bad Things
could happen. He just *assumes* that Tabs Are Bad, M'kay.

He says:

"My opinion is that the best way to solve the technical
issues is to mandate that the ASCII #9 TAB character
never appear in disk files"

How nice. And his option is worth the photons I read
them by why? It is possible that Jamie Zawinski has the
best, most logical, inarguable reasons for his opinion.
But we mere mortals will never know what those reasons
are from his essay, because he doesn't tell us.


He also says:

"I just care that two people editing the same file use
the same interpretations"

which is fair enough

"and that it's possible to look at a file and know what
interpretation of the TAB character was used, because
otherwise it's just impossible to read."

"Impossible to read" hey? That wouldn't be just a teeny
tiny overstatement, perhaps?

Out of curiosity, finding a line of text indented with
spaces (say, " "), how do you know whether that
is meant to be a single 8-space indent, two 4-space
indents, or even eight 1-space indents? Perhaps if it
is a Python program you might be able to infer correct
indentation from the program structure, but in an
arbitrary free-form text file... well, perhaps all text
files with indents are "impossible to read".

It seems to me that "one tab per indent level" is far
more logical than "some arbitrary number, N, of spaces,
often a multiple of eight, or four, or two, per indent
level, and hope that the number of spaces is a multiple
of that arbitrary N". But maybe that's just me.


He also describes tabs characters being used "for
compression". That's a strange argument -- it *assumes*
that the "real" indent is N spaces, and that an ASCII 9
tab is some sort of faux replacement. Is it not just as
likely that tabs are the real deal, and N spaces is
some sort of tab expansion?

Of course, having told the reader that ASCII 9
characters should be prohibited from text files, it
makes the author's original disclaimer "I'm trying to
avoid espousing my personal religion here" rather amusing.


For the record, I started using tabs, shifted to using
spaces because it was "recommended", got frustrated
with having to hit multiple key presses to indent and
deindent (I use lots of different editors, ranging from
kwrite to gedit to nano and even, may Wodan help me,
Windows Notepad -- not only do some editors *not* allow
auto conversion of tabs, but the ones that do are
annoyingly inconsistant in how -- and whether -- they
work), went back to tabs, got frustrated with people
complaining that indentation was being mangled by
various webmail and News clients (I never saw it
myself, mind), and went back to spaces again. I'm now
feeling sufficiently frustrated that I'm seriously
thinking of changing back to tabs, and people using
brain-dead News readers can change their client instead
of telling me to change my editor.

I'm almost fired up enough about this to start the
Society For The Treatment Of Tabs As First Class
Characters. *wink*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top