Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread James Paige
And Lo, the LORD looked upon the grave sins of the evil tabbites, and 
through the prophet James, he called upon the the wise and peaceful 
fourspacians to take up plowshares and text editors and to hammer them 
into swords, and to fall upon the wicked tabbites and rend them asunder 
with vicious bloody smiting. And when the deed had been done, the LORD 
looked down and spake so it shall be for now and for always, the 
fourspacians shall import and subclass over all the earth. But a 
certain fourspacian indented his code with only two spaces, and was 
well-pleased with himself, saying what I have done is good, and will 
please the LORD, and so the twospacians were born, and they strove 
against the fourspacians, and chaos continued in the lands of pythonia.

On Wed, May 20, 2009 at 08:58:10AM -0700, Bill Coderre wrote:
 
 With no disrespect to either my exceedingly learned colleagues from  
 Lilliput who use spaces, or my sublimely enlightened colleagues from  
 Blefuscu who use tabs[1], this is Yet Another Pointlessly Time-Wasting  
 Religious Schism.[2]
 
 The only problem is that our computers, which can be so lightning-fast  
 at replacing characters, cannot seem, even at this late date in their  
 evolution, to figure out when two lines are similarly indented and  
 therefore execute our code without complaint. Their text-editing  
 programs are only confounding the matter.
 
 My meager solution has been to turn on an option that displays a faint  
 glyph representing each tab. Therefore, when I open a file, I somewhat  
 subliminally see which lines have an indenting problem, and I fix them.
 
 Perhaps a better solution would be to agree on a spaces-tabs exchange  
 rates, but this, also has its zealots. Some people use a tab to mean  
 eight spaces, some four, and some two.
 
 Is there some unix magic cookie format to explicate this exchange  
 rate? If so, then the battle is mostly won, and we merely have to  
 convince the myriad text editors to publish, honor, and obey the  
 cookies, silently sorting out the indentations and replacing whichever  
 with whatever.
 
 If not, we just have to add the cookie format to Python's spec.
 
 [1]  cf. http://en.wikipedia.org/wiki/Endianness#Etymology
 [2] See also Endianness, above, Emacs versus vi, brackets on new  
 lines, etc.
 
 


Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread René Dudfield
surely 8 half spaces is better than 4 spaces.

cu,




On Thu, May 21, 2009 at 2:26 AM, Michael George mdgeo...@cs.cornell.eduwrote:

 Bill Coderre wrote:

 Is there some unix magic cookie format to explicate this exchange rate? If
 so, then the battle is mostly won, and we merely have to convince the
 myriad text editors to publish, honor, and obey the cookies, silently
 sorting out the indentations and replacing whichever with whatever.

 Sure!  We should just use vim modelines: vim: ts=4 sw=4 et

 That will surely avoid any pointless time-wasting religious fervor.


 --Mike



Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Yanom Mobis
my two cents: tab = 4 spaces

also a --converttabs numberOfSpaces option on the python interpreter would be 
neat, automaticly converting all tabs in the module being opened to 
numberOfSpaces spaces. So

python --converttabs 4

would convert all spaces to 4 tabs.

--- On Wed, 5/20/09, Bill Coderre b...@mac.com wrote:

From: Bill Coderre b...@mac.com
Subject: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism
To: pygame-users@seul.org
Date: Wednesday, May 20, 2009, 10:58 AM


On May 20, 2009, at 4:24 AM, d...@amberfisharts.com wrote:
 Both, tabs and spaces, work. mixing them doesn't. So you must make sure you 
 only use one. which one you choose is more or less a matter of taste as Chris 
 wrote.
 
 However, since mixing spaces and tabs is a bad idea it would be good if all 
 (python) programmers could agree on one or the other. I believe that's why 
 there is the python style guide I linked to earlier. It sets a 
 precedent/convention.
 
 You can of course say you don't care and follow your own style but it will 
 make it harder and more annoying for others.
 
 Therefore I would urge you to use spaces in python programs.

With no disrespect to either my exceedingly learned colleagues from Lilliput 
who use spaces, or my sublimely enlightened colleagues from Blefuscu who use 
tabs[1], this is Yet Another Pointlessly Time-Wasting Religious Schism.[2]

The only problem is that our computers, which can be so lightning-fast at 
replacing characters, cannot seem, even at this late date in their evolution, 
to figure out when two lines are similarly indented and therefore execute our 
code without complaint. Their text-editing programs are only confounding the 
matter.

My meager solution has been to turn on an option that displays a faint glyph 
representing each tab. Therefore, when I open a file, I somewhat subliminally 
see which lines have an indenting problem, and I fix them.

Perhaps a better solution would be to agree on a spaces-tabs exchange rates, 
but this, also has its zealots. Some people use a tab to mean eight spaces, 
some four, and some two.

Is there some unix magic cookie format to explicate this exchange rate? If so, 
then the battle is mostly won, and we merely have to convince the myriad text 
editors to publish, honor, and obey the cookies, silently sorting out the 
indentations and replacing whichever with whatever.

If not, we just have to add the cookie format to Python's spec.

[1]  cf. http://en.wikipedia.org/wiki/Endianness#Etymology
[2] See also Endianness, above, Emacs versus vi, brackets on new lines, etc.



  

Re: [pygame] Spaces And Tabs Pointlessly Time-Wasting Religious Schism

2009-05-20 Thread Greg Ewing

Bill Coderre wrote:

Perhaps a better solution would be to agree on a spaces-tabs exchange  
rates


That would negate the main benefit of using tabs (only),
which is precisely that they *don't* represent any fixed
amount of indentation. You can set your editor to display
them using whatever spacing you prefer.

Unfortunately, the totally haphazard way that the various
tools out there handle tabs makes it impractical to use
them this way outside of a controlled environment.

Given that, the convention of four-space indents makes
sense as an *interchange* format. Use whatever works best
for you internally, but convert to four-space indents
when sharing code with others.

Cookies wouldn't really help unless all the tools out
there (not just text editors, but print formatters,
mail and news handlers, etc.) understood them. And if we
had the power to make them do that, we could make them
handle tabs in a consistent way in the first place, and
we wouldn't have a problem.

--
Greg