[NCLUG] Looking at programming languages...
Stephen Warrren
swarren at wwwdotorg.org
Thu Jan 17 11:03:49 MST 2008
On Thu, January 17, 2008 10:35 am, Walker, Philip M (Optical Storage) wrote:
> Python is good stuff, but one limitation prevents me from becoming
> enthusiastic:
>
> the indentation relies on the assumption that tabs (if present) are
> unambiguously equivalent to 8 spaces.
<rant>
TABS ARE 8 SPACES.
REPEAT AFTER ME:
TABS ARE 8 SPACES.
</rant>
The definition of TAB stops is that they move the cursor to the next
8-character-aligned position.
There is zero actual correlation between programming indent levels and TAB
stops.
It's just that some lazy editor writers decided that the only way to do
auto-indentation was to insert TAB characters and hard-coded that, and
then other people didn't want their indent levels to be 8 characters, so
rather than fixing the editors to indent with spaces, people hacked (in
the bad sense) editors to fsck up the definition of a TAB character to
solve the problem in an extremely lazy manner.
<rant>
Indent with spaces. It solves all your problems with TABs, and lets you
configure your editor's definition of TABs to match the correct
8-character definition.
If you don't indent with spaces, you'll find your indentation is screwed
when somebody else has a different setting for TAB width (like perhaps the
correct one), or they print your code, etc.
</rant>
More information about the NCLUG
mailing list