Outlaw tabs

Achim Schneider barsoap at web.de
Sun Jan 25 23:15:38 EST 2009


Twan van Laarhoven <twanvl at gmail.com>
wrote:

> Jon Fairbairn wrote:
> > Warnings are the wrong answer to this problem.  In fact,
> > they're rarely the right answer to any problem. Tabs in
> > sourcecode can have bad effects, and Haskell is a language
> > that attempts to reject bad effects as far as possible. Nor
> > can I see any argument in favour of allowing tabs (if HT is
> > allowed, why not VT?).
> 
> Tabs can be convenient for quick scripts and things like that, where
> you wouldn't use -Wall. And while I keep hearing about the problems
> with tabs, I have never encountered any with Haskell code.
> 
I don't understand how tabs in your code can be convenient for quick
scripts, considering that you'd have to switch your editor from sane
behaviour, that is expanding them to a number of spaces suitable to
your taste, to zomg-I-have-to-waste-space-on-8-space-tabs to prevent
any problems with Haskell code.

But that's all beside the point. Tabs are a reminiscence of early
typewriters used to layout tables that made their way onto early text
terminals and onto modern PC's. I don't really understand why, as
they have been and always will be obsolete and problematic on
everything but a mechanical typewriter.

It's not just Haskell code, or generally layout-rule syntax, but any
syntax: Did you ever have a look at a mixed tab/space-indent C file
with another tab width setting than the original author? Sure, {}'s
will help you along, but not before your eyes exploded.

If you want a table, use latex or a spreadsheet: Don't use a typewriter.
If you want to indent your code, use spaces so everyone sees the same
code and does not have to stick indents to tab stops.

If you want a key to quickly indent your code, use that funky key with
those two arrows, but don't let it produce a tab character while you're
editing text. Preferably, let it analyse the syntax of the previous line
and automagically Indent By The Right Amount.

Finally, for great profit, remove \t out of your ASCII table. There
would be less wars.

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.




More information about the Haskell-prime mailing list