[issue7012] Tabs is better than spaces for identation

2009-09-28 Thread Rohde Fischer

New submission from Rohde Fischer :

Although it's probably futile, I'll still give it a try.

I can see in your tutorial that you desire 4 spaces over tabs. I have 
never seen a good argument for spaces (and I've seen a lot), so I'll 
try to convince that tabs is the way (god damn it we don't live in 1980 
any more).

>From the tutorial: "Tabs introduce confusion, and are best left out." - 
only if you're switching in the middle of a document, tabs and spaces 
are equally confusing (I would say they're the opposite, but ok). 
There's no difference on that part.

Then some of the arguments I've heard is that some editors shows tabs 
badly, although true, then most proper editors it's possible to adjust 
that to your personal preference, removing that possibility you are 
removing a nice (although not entirely needed) flexibility.

In a program with 200 lines of code we have roughly 600 extra 
keystrokes with spaces, unless using a proper editor which shows tabs 
nicely.

Tabs use less space, which is usable when uploading and downloading 
code a lot (which you do when using version control).

Posting on forums is a problem with tabs. True, but then you can use 
proper utilities for that, and although I don't use forums for code 
issues I would seriously question the forum if a code-related forum 
didn't convert tabs, and even if it doesn't then I would still use a 
pastebin utility, since it offers all those nice features like syntax 
highlighting and auto conversion of tabs.

4 spaces is prettier than tabs converted to 8 spaces. True but yet 
again most editors can adjust that or actually use 4 spaces per 
default, but if I like 2 spaces I can't do that without introducing 
confusion, so spaces actually introduces more confusion than tabs.

Good editors makes spaces transparent and behave like tabs, true but 
good editors also makes tabs look pretty. But editing manual spaces is 
hell compared to the ugliness of a bad editor, and I prefer usability 
over pretty.

This don't look good with tabs
string = "some multiline whatever string"+
 " and continued"
string = "some multiline whatever string"+
" and continued"
True, but not unreadable, and if insisting on pretty you can switch to 
tabs for identation spaces for multiline prettyness.

So until I see good arguments for spaces I would really like to see the 
standard switched to tabs, since I see no good reason for claiming 
spaces is better ... actually so see reason to claim otherwise.

--
components: None
messages: 93205
nosy: rohdef
severity: normal
status: open
title: Tabs is better than spaces for identation
type: feature request

___
Python tracker 
<http://bugs.python.org/issue7012>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7012] Tabs is better than spaces for indentation

2009-09-29 Thread Rohde Fischer

Rohde Fischer  added the comment:

> Python started out using tabs, for some of the reasons you elaborate.
> Years of practical experience have shown that using tabs causes pain.
> Our recommendation is not going to change.
I can't actually see why this should be the case, could you please 
enlighten me here?

> > Then some of the arguments I've heard is that some editors shows
> > tabs badly, although true, then most proper editors it's possible
> > to adjust that to your personal preference
> That is no option for Python. In Python, it is part of the LANGUAGE
> SYNTAX that a tab is 8 columns. Changing that may change the very
> meaning of a Python program (i.e. an editor configured to four column
> tabs may render a program to MEAN something different than when
> formatted to eight column tabs).
I fail to see that this is possible, simply from the following reason 
(space after \t added for readability)
if a > In a program with 200 lines of code we have roughly 600 extra
> > keystrokes with spaces, unless using a proper editor which shows
> > tabs nicely.

> I think you should get a different editor then. I press tab in my
> editor and still get four spaces.
Ok I though I managed to make it clear that I know the possibilities of 
editors, but ok. I'm perfectly aware of that possibility, but so far 
I'm not interested. I see no reasons for spaces apart from making a lot 
of things harder without benefits (I still fail to see any benefit)

> > Tabs use less space, which is usable when uploading and downloading
> > code a lot (which you do when using version control).

> That's negligible, compared to the rest of the file.

Might be true, but with the present speed of most free svn server even 
little gained is useful. I'm actually disappointed of how bad their 
download is (just in case someone wonders: I have tested my upload)

> Wow. You (rohdef) really do sound like you are a time capsule from
> the eighties. Tabs would save keystrokes and bandwidth, and are not
> confusing? The keystrokes argument is wrong for most editors;
I'm aware (I'm surprised that it's unclear from what I wrote that I'm 
aware of the most basic capabilities of an IDE, but ok that's besides 
the point), but I'm probably not the only one in the world being forced 
to work on crappy editors from time to time, even though I try to avoid 
it.

> the bandwidth argument doesn't matter due to disk size, network
> speed, and compression;
Although it might not be much I still feel that it's a waste, but as 
far as I see this is the only point where I'm like a time capsule from 
the 80's. But still even little saved matters when using SF og Google 
Code for svn (I was a bit shocked on how slow they are, and to be 
honest I use another that's nice and fast in stead).

> and the confusion is absolutely real.
But none has pointed it out yet, the only confusion I've seen so far is 
from people having contradicting beliefs on the tabs vs spaces. So far 
I've never seen a reason to change my opinion, since I've only seen 
spaces as trouble.

> Pretty much every time I volunteer to help out a group of Python
> newbies there is at least one baffling problem due to tabs/spaces.
> There are hundreds of different text editors that people use on a
> regular basis to edit Python source code. They all display spaces
> the same way; not so for tabs.
The beauty of flexibility :) Besides that I've never seen problems due 
to tabs shown differently as long as it's not treated in some insane 
way that would be inappropriate for an IDE, so I won't consider those.

> Most of them have configurable behavior for tabs, and most of the
> time the users are not aware of even the existence of those settings,
> let alone what setting is currently being used.
And since most developers is unaware of things like compile options in 
compiled languages, should we remove that too? Even though most people 
aren't aware (either because of the lack of need or interest to change 
it) of the settings, there's no reason to remove that for us who know 
and care.


I'll try to say what I indirectly said. Show my why things are like you 
say it is. Why is tabs confusing? Why is spaces better? I can't use 
empty arguments without any proof. I can't use a "it's just like that"-
argument, only thing I can use that for is wasting my time.

--

___
Python tracker 
<http://bugs.python.org/issue7012>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com