Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-18 Thread Christophe
Carl J. Van Arsdall a écrit : glomde wrote: But If you work in a team it is kind of hard to make sure that everybody use tabs and not spaces. And it is not very easy to spot either. The converse can also be said, it's difficult to make sure everyone uses spaces and not tabs.

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-18 Thread achates
Edward Elliott wrote: What really should happen is that every time an editor reads in source code, the code is reformatted for display according to the user's settings. The editor becomes a parser, breaking the code down into tokens and emitting it in a personally preferred format. I

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-18 Thread Edward Elliott
Christophe wrote: No, it's really easy : a simple precoomit hook which will refuse any .py file with the \t char in it and it's done ;) $ echo \t t Why would you wan_ _o remove all _ee charac_ers? Isn'_ _ha_ a li__le awkward? -- Edward Elliott UC Berkeley School of Law (Boalt Hall)

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Andy Sy
achates wrote: Andy Sy: Code with anything other than 8-space tabs will *NEVER* display properly using everyday unix utilities such as less and cat. less -xtabstop does what you want. Ok, that tip certainly counts for something. This is definitely going to make viewing tabbed code suck

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Carl J. Van Arsdall
Andy Sy wrote: achates wrote: Andy Sy: Code with anything other than 8-space tabs will *NEVER* display properly using everyday unix utilities such as less and cat. less -xtabstop does what you want. Ok, that tip certainly counts for something. This is definitely

Re: Tabs versus Spaces in Source Code (semantic vs. arbitrary indentation)

2006-05-17 Thread Andy Sy
Ed Singleton wrote: On 5/15/06, Brian Quinlan [EMAIL PROTECTED] wrote: The problem with tabs is that people use tabs for alignment e.g. def foo(): -query = SELECT * - - - FROM sometable - - - WHERE condition Now I change my editor to use 8-space tabs and the code is all

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Andy Sy
Carl J. Van Arsdall wrote: Next major objection then, how can one practically use 'tabs as semantic indentation' without screwing up formatting of code like the below?? def sqlcall(): cursor.execute('select id, item, amount, field4, field5, field6'+ 'from

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Carl J. Van Arsdall
Andy Sy wrote: Carl J. Van Arsdall wrote: Next major objection then, how can one practically use 'tabs as semantic indentation' without screwing up formatting of code like the below?? def sqlcall(): cursor.execute('select id, item, amount, field4, field5, field6'+

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Dave Hansen
On Wed, 17 May 2006 12:02:46 -0700 in comp.lang.python, Carl J. Van Arsdall [EMAIL PROTECTED] wrote: Andy Sy wrote: Carl J. Van Arsdall wrote: Next major objection then, how can one practically use 'tabs as semantic indentation' without screwing up formatting of code like the below??

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Carl J. Van Arsdall
Dave Hansen wrote: On Wed, 17 May 2006 12:02:46 -0700 in comp.lang.python, Carl J. Van Arsdall [EMAIL PROTECTED] wrote: Andy Sy wrote: Carl J. Van Arsdall wrote: Next major objection then, how can one practically use 'tabs as semantic indentation' without screwing up

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread achates
Andy Sy wrote: def sqlcall(): cursor.execute('select id, item, amount, field4, field5, field6'+ 'from table1 where amount100') Lines two and three (a continuation line) are both at a syntactic indentation level of 1. Therefore they should both start with a

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread achates
Dave Hansen wrote: However, to twist an observation I've read about C++, while it's clearly possible to use TABs in a sensible manner like this, it seems that no one does. I think it's evident from this thread that quite a few people do that, judging by the fact that my previous post explaining

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Sybren Stuvel
Dave Hansen enlightened us with: Assume the code was written by someone using 4-space tabs. To them, the code is: def sqlcall(): ---cursor.execute('select id, item, amount, field4, etc ...'from table1 where amount100') (where --- represents an 4-space tab and .

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread glomde
But generally, I don't do layout like that. I'd do: ---cursor.execute( -'select id, item, amount, field4, etc -'from table1 where amount100' ---) Which keeps looking fine, no matter what tab size, and without mixing tabs and spaces. Which only works fine only if

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Carl J. Van Arsdall
glomde wrote: But If you work in a team it is kind of hard to make sure that everybody use tabs and not spaces. And it is not very easy to spot either. The converse can also be said, it's difficult to make sure everyone uses spaces and not tabs. I think we've just about beat this

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread achates
Carl J. Van Arsdall wrote: The converse can also be said, it's difficult to make sure everyone uses spaces and not tabs. I think we've just about beat this discussion to death... nice work everyone! Yeah - we've got to the repeating ourselves stage. But that's the problem with this issue:

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Dave Hansen
On 17 May 2006 16:13:54 -0700 in comp.lang.python, achates [EMAIL PROTECTED] wrote: Carl J. Van Arsdall wrote: The converse can also be said, it's difficult to make sure everyone uses spaces and not tabs. I think we've just about beat this discussion to death... nice work everyone! Yeah -

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Edward Elliott
We've finally hit the meta-discussion point. Instead of talking about tabs and spaces, we're talking about talking about tabs and spaces. Which frankly is a much more interesting conversation anyway. achates wrote: Does it matter? Perhaps not if we can use tools which enable us to bridge the