[EMAIL PROTECTED]
∑ http://xahlee.org/
Xah Lee wrote:
Tabs versus Spaces in Source Code
This post is archived at:
http://xahlee.org/UnixResource_dir/writ/tabs_vs_spaces.html
--
http://mail.python.org/mailman/listinfo/python-list
or
IDE that actually allows the coder to manually highlight parts of the
code and this highlight stick with the file upon reopening, as if a
word processor?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Xah Lee wrote:
Tabs versus Spaces in Source Code
This post is archived
Jonathon McKitrick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Pascal Bourguignon wrote:
(defun ιοτα (key (номер 10) (단계 1) (בכוכ 0))
(loop :for i :from בכוכ :to номер :by 단계 :collect i))
How do you even *enter* these characters? My browser seems to trap all
the special
achates wrote:
Yeah - we've got to the repeating ourselves stage.
Actually a couple of the responses on this newsgroup
have settled the question for me. I did learn something
new by engaging in this holy war.
Tabs need not be evil, but ONLY if they are used in one
particular way:
If you
Christopher Weimann wrote:
On 05/19/2006-07:18AM, Duncan Booth wrote:
My experience of programming with either spaces or tabs has taught me
that tabs are evil not for themselves, but simply because no matter how
hard you try they always end up being mixed with spaces.
Swap the word
On Thu, 18 May 2006 08:30:03 +, Duncan Booth wrote:
PoD wrote:
How many levels of indentation does 12 spaces indicate?
It could be 1,2,3,4,6 or 12. If you say it's 3 then you are
_implying_ that each level is represented by 4 spaces.
By reading the code I can see how many levels of
On Thu, 18 May 2006 10:33:58 +0200, Christophe wrote:
PoD a écrit :
On Wed, 17 May 2006 21:37:14 +0800, Andy Sy wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
From the Zen of Python:
Explicit is better than implicit...
In the face of
PoD wrote:
I think it is universally accepted that mixed tabs and spaces is indeed
**EVIL**
I should have said any code using tabs exclusively.
Can you point at any significant body of publically visible Python code
which uses tabs exclusively? All of the Python projects I've ever been
PoD a écrit :
Maybe what Python should do (but never will given the obsession with using
spaces) is only allow one level of indentation increase per block so that
def foo():
TABTABreturn 'bar'
would return a syntax error
Which would make TAB mandatory for indentation. What about some
Duncan Booth enlightened us with:
Can you point at any significant body of publically visible Python
code which uses tabs exclusively?
Everything Python at http://www.stuvel.eu/software
Also, in the open source universe you are quite likely to pull in
bits of code from other projects, and
On 19 May 2006 07:18:03 GMT in comp.lang.python, Duncan Booth
[EMAIL PROTECTED] wrote:
[...]
My experience of programming with either spaces or tabs has taught me
that tabs are evil not for themselves, but simply because no matter how
hard you try they always end up being mixed with spaces.
On Fri, 19 May 2006 10:04:15 +0200, Christophe wrote:
PoD a écrit :
Maybe what Python should do (but never will given the obsession with using
spaces) is only allow one level of indentation increase per block so that
def foo():
TABTABreturn 'bar'
would return a syntax error
Which
On 19 May 2006 07:18:03 GMT, Duncan Booth [EMAIL PROTECTED]
Can you point at any significant body of publically visible Python code
which uses tabs exclusively? All of the Python projects I've ever been
involved with use spaces only as a convention (although as I pointed out in
my previous
On 05/19/2006-07:18AM, Duncan Booth wrote:
My experience of programming with either spaces or tabs has taught me
that tabs are evil not for themselves, but simply because no matter how
hard you try they always end up being mixed with spaces.
Swap the word 'tabs' for the word 'spaces' and
On Mon, 15 May 2006 02:44:54 GMT, Eli Gottlieb [EMAIL PROTECTED]
wrote, quoted or indirectly quoted someone who said :
Actually, spaces are better for indenting code.
Agreed. All it takes is one programmer to use a different tab
expansion convention to screw up a project. Spaces are
On Wed, 17 May 2006 21:37:14 +0800, Andy Sy wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
From the Zen of Python:
Explicit is better than implicit...
In the face of ambiguity, refuse the temptation to guess...
Special cases aren't
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.
PoD wrote:
How many levels of indentation does 12 spaces indicate?
It could be 1,2,3,4,6 or 12. If you say it's 3 then you are
_implying_ that each level is represented by 4 spaces.
By reading the code I can see how many levels of indentation it
represents.
How many levels of indentation
PoD a écrit :
On Wed, 17 May 2006 21:37:14 +0800, Andy Sy wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
From the Zen of Python:
Explicit is better than implicit...
In the face of ambiguity, refuse the temptation to guess...
Special cases
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
Bill Pursell [EMAIL PROTECTED] writes:
In my experience, the people who complain about the use
of tabs for indentation are the people who don't know
how to use their editor, and those people tend to use
emacs.
HA HA HA HA HA HA HA HA HA HA HA HA
Tee, hee heee snif!
Phew. Better
Duncan Booth wrote:
No. That is precisely the problem: there is code in the wild which
contains mixed space and tab indentation...
followed by some good examples of mixed tab and space indentation
I wouldn't have a problem with tabs if Python rejected mixed indentation by
default, because
Edmond Dantes [EMAIL PROTECTED] writes:
It all depends on your editor of choice. Emacs editing of Lisp (and a few
other languages, such as Python) makes the issue more or less moot. I
personally would recommend choosing one editor to use with all your
projects, and Emacs is wonderful in that
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)
Jonathon McKitrick [EMAIL PROTECTED] writes:
Pascal Bourguignon wrote:
(defun ιοτα (key (номер 10) (단계 1) (בכוכ 0))
(loop :for i :from בכוכ :to номер :by 단계 :collect i))
How do you even *enter* these characters? My browser seems to trap all
the special character combinations, and I
Jonathon McKitrick wrote:
Pascal Bourguignon wrote:
(defun ιοτα (key (номер 10) (단계 1) (בכוכ 0))
(loop :for i :from בכוכ :to номер :by 단계 :collect i))
How do you even *enter* these characters? My browser seems to trap all
the special character combinations, and I *know* you don't mean
achates wrote:
Duncan Booth wrote:
However the important thing is that a tab does
not map to a single indentation level in Python: it can map to any
number of indents, and unless I know the convention you are using to
display the tabs I cannot know how many indents are equivalent to a
tabstop.
Duncan Booth enlightened us with:
In particular a common convention is to have indentations at 4
spaces and tabs expanding to 8 spaces.
Aaaw that is SO ugly! Sure, it displays correctly on systems that have
tab stops every 8 spaces given a monospaced font, but that is about
all that is positive
Duncan Booth enlightened us with:
It is strange. You use many of the same words as me, but they don't make
any sense.
You forgot to add to me to the end of that sentence. Personally,
Achates' words made perfect sense to me.
The point is about separating the presentation of the source file
I think Duncan has hit the nail on the head here really. I totally
agree that conceptually using tabs for indentation is better than using
spaces. Pragmatically though, you can't tell in an editor where spaces
are used and where tabs are used.
Perhaps if editors colored the background of tab
Ant wrote:
I think Duncan has hit the nail on the head here really. I totally
agree that conceptually using tabs for indentation is better than using
spaces. Pragmatically though, you can't tell in an editor where spaces
are used and where tabs are used.
Um, I don't follow this. If you
Harry George wrote:
This has been discussed repeatedly, and the answer is If you only
work alone, never use anyone else's code and no one ever uses your
codes, then do as you please. Otherwise use tab-is-4-spaces.
When you do Agile Programming with people using emacs, vim, nedit,
xedit,
Please... just stop this senseless defense of
a Rube-Goldberg feature.
There will NEVER be a universal agreement on
whether tabs should be 2, 3, 4 or 8 spaces in
width, and this causes endless tweaking of editor
settings (a *humongous* waste of time) to handle
source code made by other
Iain King wrote:
python -tt
Indeed. I reckon the consensus here (to the extent that there is any!)
is that it would be better if this was Python's default behaviour.
The argument (not advanced by Iain but by others in this thread) that:
novices will mix tabs and spaces = we should all use
Andy Sy wrote:
Don't be evil - always configure your editor to
convert tabs to true spaces.
Yet another space-indenter demonstrates that problem actually lies with
people who think that tab == some spaces.
And I, for the life of me, have never remembered
getting any source code to display
Ant wrote:
spaces. Pragmatically though, you can't tell in an editor where spaces
are used and where tabs are used.
Um, I don't follow this. If you can't tell the editor where
tabs/spaces are used, who does?
Re-read my post. Note the key word 'in'.
Perhaps if editors colored the
Not that it's relevant, but I've never actually encountered anyone who
mixed tabs and spaces.. I've lived a sheltered life I guess.
It's not individuals using a mixture, but when working in a development
team of some kind. Consider person A who writes a file using spaces for
indent. Person B
achates wrote:
It's horrible but at least it would insulate me from the greater
hideousness of having to hit the spacebar like a madman at the start of
every line of code. I can even see how to get it to work in vi at
least.
Hitting the spacebar like a madman? If you have a sensible editor
Andy Sy wrote:
Don't be evil - always configure your editor to
convert tabs to true spaces.
achates [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Yet another space-indenter demonstrates that problem actually lies with
people who think that tab == some spaces.
Exactly.
Hitting the spacebar like a madman? If you have a sensible editor then at
the start of a line you press tab once
True! but normally if I'm editing someone else's code then I'm only
making small changes and so can't be bothered to temporarily cripple my
editor. If I'm merging my code with someone
achates enlightened us with:
True! but normally if I'm editing someone else's code then I'm only
making small changes and so can't be bothered to temporarily cripple my
editor. If I'm merging my code with someone else's space-indented code
then piping through sed 's/TAB/SPACES' does the trick.
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
From the Zen of Python:
Explicit is better than implicit...
In the face of ambiguity, refuse the temptation to guess...
Special cases aren't special enough to break the rules...
--
It's called DOM+XHR
achates wrote:
Andy Sy wrote:
Don't be evil - always configure your editor to
convert tabs to true spaces.
Yet another space-indenter demonstrates that problem actually lies with
people who think that tab == some spaces.
Wrong. I am completely aware that an editor configured to
convert
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
I don't seem to understand your point in acting as a dictator.
Therefore, you are a MISfeature and need to be removed.
--
# p.d.
--
achates wrote:
Hitting the spacebar like a madman? If you have a sensible editor then at
the start of a line you press tab once
True! but normally if I'm editing someone else's code then I'm only
making small changes and so can't be bothered to temporarily cripple my
editor. If I'm merging
Xah Lee wrote:
Tabs versus Spaces in Source Code
Xah Lee, 2006-05-13
In coding a computer program, there's often the choices of tabs or
spaces for code indentation.
snip
(2) Due to the first reason, they have created and
propagated a massive none-understanding and mis-use, to the degree
On 17 May 2006 06:51:19 -0700, Bill Pursell [EMAIL PROTECTED] wrote:
In my experience, the people who complain about the use
of tabs for indentation are the people who don't know
how to use their editor, and those people tend to use
emacs.
In my experience, whenever there is a 'religious'
Peter Decker wrote:
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
I don't seem to understand your point in acting as a dictator.
Therefore, you are a MISfeature and need to be removed.
Is the above an
Peter Decker [EMAIL PROTECTED] wrote:
In my experience, whenever there is a 'religious' issue like this, one
side tends to be quick to pronounce the other as 'evil', and insist
that everyone do things their way,
I don't think people who use tabs are evil. They may be ignorant and
misguided, but
Peter Decker wrote:
On 17 May 2006 06:51:19 -0700, Bill Pursell [EMAIL PROTECTED] wrote:
In my experience, the people who complain about the use
of tabs for indentation are the people who don't know
how to use their editor, and those people tend to use
emacs.
In my experience,
Peter Decker wrote:
Spaces look like crap, too, when using proportional fonts.
... and people who would even think that using proportional
fonts for viewing/editing source code is anywhere remotely
near being a good idea ...
That's an even more advanced version of the i-think-tabs-are-good
Jorge Godoy wrote
Emacs guess what's used in the file and allows me to use tabs all the time,
doing the correct thing...
That sounds like useful behaviour.
Maybe this is an area where modern editors might be able to save us
from ourselves. I'll admit I'm suspicious of relying on editor
Andy Sy enlightened us with:
Now... if you say you SHOULDN'T mix tabs and spaces (indeed this is
generally regarded as a BAD idea esp. in Python code)
I indeed say so.
then WHAT THE HECK do you need to use tab characters in the source
code for anyway (besides saving a measly few bytes) ??!?
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
Peter Decker wrote:
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
I don't seem to understand your point in acting as a dictator.
Therefore, you are a
On 17 May 2006 07:14:33 -0700, Bill Pursell [EMAIL PROTECTED] wrote:
I think you unfairly snipped context on me. I was directly responding
to the assertion that vi is unable to handle tabs well.
I was *agreeing* with you. Sorry if that wasn't clear.
--
# p.d.
--
Peter Decker wrote:
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
Peter Decker wrote:
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
If tabs are easily misunderstood, then they are a MISfeature
and they need to be removed.
I don't seem to understand your point in acting as a dictator.
On 5/17/06, Andy Sy [EMAIL PROTECTED] wrote:
Uh, I should know better than to try to educate, but FYI: using the
same argument construction and having it reach an invalid conclusion
suffices to show that the original construction is invalid, and thus
the original conclusion is suspect.
Andy Sy
I guess this *REALLY* is how a misguided tab user exercises his 'logic':
Syntax replication (e.g. so-called 'argument construction') is enough,
semantics don't matter.
That's quite amusing.. you've unwittingly stumbled on a pretty concise
statement of Hilbert's first postulate of formal
achates wrote:
Andy Sy
I guess this *REALLY* is how a misguided tab user exercises his 'logic':
Syntax replication (e.g. so-called 'argument construction') is enough,
semantics don't matter.
That's quite amusing.. you've unwittingly stumbled on a pretty concise
statement of Hilbert's
Sybren Stuvel wrote:
then WHAT THE HECK do you need to use tab characters in the source
code for anyway (besides saving a measly few bytes) ??!?
To separate layout (how much indentation is used) from semantics (how
many intentation levels).
Like I said, you'll *NEVER* get that fancy shmancy
Andy Sy enlightened us with:
Like I said, you'll *NEVER* get that fancy shmancy 'semantic
indentation' idea to work properly in the most basic utilities which
have the 8-space tabs assumption hardcoded in them.
Fair enough. How much code is viewed with less and cat, and how much
is viewed
Sybren Stuvel wrote:
Andy Sy enlightened us with:
Like I said, you'll *NEVER* get that fancy shmancy 'semantic
indentation' idea to work properly in the most basic utilities which
have the 8-space tabs assumption hardcoded in them.
Fair enough. How much code is viewed with less and
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.
--
http://mail.python.org/mailman/listinfo/python-list
achates wrote:
Jorge Godoy wrote
Emacs guess what's used in the file and allows me to use tabs all the
time, doing the correct thing...
That sounds like useful behaviour.
vim can do it to.
http://www.vim.org/scripts/script.php?script_id=1171
--
Edward Elliott
UC Berkeley School of Law
Sybren Stuvel wrote:
Andy Sy enlightened us with:
Like I said, you'll *NEVER* get that fancy shmancy 'semantic
indentation' idea to work properly in the most basic utilities which
have the 8-space tabs assumption hardcoded in them.
Fair enough. How much code is viewed with less and cat,
I use Edit Plus for all my text-editing needs. With a simple
shift-alt-i it faintly displays all spaces as little dots and all tabs
as '' (but using the single ascii character instead). I use tabs to
indent blocks, then if stuff within a block needs to be aligned (such
as if statements or
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
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
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
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
On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott
[EMAIL PROTECTED] wrote:
Sybren Stuvel wrote:
Andy Sy enlightened us with:
Like I said, you'll *NEVER* get that fancy shmancy 'semantic
indentation' idea to work properly in the most basic utilities which
have the 8-space
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'+
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??
Dave Hansen wrote:
That will work. As long as the creator of file used four-space TABs,
anyway...
That sentence has no meaning. There is no such thing as a four-space
tab.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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 .
Dave Hansen wrote:
On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott
Just for the sake of completeness:
cat file |sed 's/\t//g'
That doesn't always work. If you don't see why, you don't understand
my objection to TAB characters in text files.
less -x4 file
That
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
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
Oliver Bandel wrote:
[EMAIL PROTECTED] opalinski from opalpaweb wrote:
...
Yes, as I started programming I also preferred tabs.
And with growing experience on how to handle this in true life
(different editors/systems/languages...) I saw, that
converting the so fine tabs was annoying.
The
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On May 17, 2006, at 8:46 PM, Edward Elliott wrote:
Dave Hansen wrote:
On Wed, 17 May 2006 17:28:26 GMT in comp.lang.python, Edward Elliott
Just for the sake of completeness:
cat file |sed 's/\t//g'
That doesn't always work. If you don't
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:
Edward Elliott wrote:
Dave Hansen wrote:
I fail to see why less 'will work' but cat 'doesn't always work'.
The distinction is not in the choice of program, but in the
way it is being used...
The net
effect of both is the same. Unless you're in some weird place that pipes
aren't allowed,
William Studenmund wrote:
The problem is that tabs take you to the next tab stop, they don't
expand to a fixed number of spaces.
Got it. You're talking about using tabs other than for initial line
indentation on a source file. Yes, then tab expansion is not perfect.
--
Edward Elliott
UC
Terry Hancock wrote:
Now, of course, the data I provide is nasty, mean, poorly-formatted
data, abhorable by space-zealots and tab-libertines alike (;-)), but the
point is, unless you have set up your editor to syntax color spaces
and tabs differently, you won't see the difference in the
Edmond Dantes wrote:
The real issue is, of course, that ASCII is showing its age and we should
probably supplant it with something better. But I know that will never fly,
given the torrents of code, configuration files, and everything else in
ASCII. Even Unicode couldn't put a dent in it, despite
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 -
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
achates wrote:
Jorge Godoy wrote
Emacs guess what's used in the file and allows me to use tabs all the
time, doing the correct thing...
That sounds like useful behaviour.
Maybe this is an area where modern editors might be able to save us
from ourselves. I'll admit I'm suspicious of
If I work on your project, I follow the coding and style standards you
specify.
Likewise if you work on my project you follow the established
standards.
Fortunately for you, I am fairly liberal on such matters.
I like to see 4 spaces for indentation. If you use tabs, that's what I
will
achates wrote:
A tab is not equivalent to a number of spaces. It is a character
signifying an indent, just like the newline character signifies the end
of a line. If your editor automatically converts tabs to spaces (i.e.
you are unable to create source files containing tabs) then either it's
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 messed
up. Of course,
Duncan Booth enlightened us with:
That is true so far as it goes, but equally if your editor inserts a
tab character when you press the tab key it is as broken as though
it inserted a backspace character when you press the backspace key.
In both of these cases you have an operation (move to
Oh God, I agree with Xah Lee. Someone take me out behind the chemical
sheds...
Iain
Xah Lee wrote:
Tabs versus Spaces in Source Code
Xah Lee, 2006-05-13
In coding a computer program, there's often the choices of tabs or
spaces for code indentation. There is a large amount of confusion
Sybren Stuvel wrote:
An editor should be capable of letting you create or modify files
containing control characters without gratuitously corrupting them,
but the keys should perform the expected operations
I agree with that.
not insert the characters.
But not with that, since it is
Duncan Booth enlightened us with:
It could be, and for some keys (q, w, e, r, t, y, etc. spring to
mind) that is quite a reasonable implementation. For others 'tab',
'backspace', 'enter', 'delete', etc. it is less reasonable, but it
is a quality of implementation issue. If I had an editor
An old debate. My $0.02 :
http://numeromancer.dyndns.org/~timothy/tab-width-independence/description.html
The idea can be extended to other programming languages.
TS
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
Tabs versus Spaces in Source Code
Xah Lee, 2006-05-13
In coding a computer program, there's often the choices of tabs or
spaces for code indentation. There is a large amount of confusion about
which is better. It has become what's known as “religious war” —
a heated fight
1 - 100 of 134 matches
Mail list logo