A 'Python like' language

Josiah Carlson jcarlson at nospam.uci.edu
Sat Mar 27 15:05:15 EST 2004


>>At any rate, I agree with John that the Prothon folks got this particular
>>bit dead wrong.  If they wanted to avoid tab/space problems they should have
>>required that all indentation use only spaces, not only tabs.
> 
> The advantage of tabs ( a small one in my opinion ) is that the reader
> can adjust the actual spacing to his preference.

Funny, but I can do a search and replace to do the same.  In fact, I use 
search and replace to get rid of the tabs that newbies use in Python code. *

> Another advantage is
> that you can add leading spaces for purely cosmetic reasons (lining up
> columns in a continuation line ).  The tabs control the syntax.

When you have line continuations, spacing on the subsequent line doesn't 
matter, so this "advantage" you cite, is not an advantage.


> The solution I believe, is to have a special 'publishing' mode where
> tabs are replaced by the character sequence '.   ' with however many
> spaces the sender wants.  The dots actually make large, deeply-nested
> blocks easier to read.

For you, it makes large, deeply-nested blocks easier to read.  That may 
not be the case for other people.  Furthermore, having a special 
"publishing" mode, in order to replace tabs with spaces (and a .), is 
just trying to fix the problem of tabs, which can be fixed much easier 
with not using tabs in the first place.


> Of course, we will need a matching import mode, converting the
> dot-space sequences back to tabs.

* The trick is that '.   ' is a valid stream of characters not inside an 
indent sequence:

def blah():
     """I am a docstring with some bullet-like things.
.   bullet point 1
.   bullet point 2
.   bullet point 3
.   bullet point 4
"""
When you replace '.   ' with tab characters, you end up changing the 
contents of the docstring.  It also makes it less straightforward to 
give code to people who /don't/ have editors that are aware of this 
arbitrary method of representing tabs.

Tabs as scope was a mistake, Guido has pronounced it as such.  The fact 
that Prothon is using it as its /only/ scope delimiter, means that they 
are making an even bigger mistake, that they won't be able to get out of 
easily if/when they get many users.

  - Josiah



More information about the Python-list mailing list