Polytropon wrote:
On Tue, 31 Mar 2009 07:48:00 -0400, William Gordon Rutherdale 
<will.rutherd...@utoronto.ca> wrote:
Tabbing is the worst form of indentation. It is *much* better to use spaces consistently.


may I ask what exactly you mean by "consistently"? I've seen
various opinions about how many spaces make up one indentation level,
beginning from 1, over 4, up to 10. Where's the consistency, or is
it defined on a per-programmer basis?

Are you serious?  You set the standard on a given project.  You decide
whether you are using spaces or tabs.  If spaces, you decide how many
spaces per indent level.  You ask the programmers to submit code in that
format.  It doesn't jump around randomly from one line to the next.

You are trying to make it sound like a big problem, but it isn't.

And why is this much better?
Just my view based on years of experience.  Don't take it too seriously.

When I would compare both indentation forms, I'd say that tabbing
is the better form because
 + you can set your individually preferred tab with using the
   settings of your editor, be it 1, 4 or 8,
Why is this flexibility important?  The more important thing is to have
consistently indented code.  There is no great benefit in letting
different programmers see the code indented to different levels.  They
just want to be able to read it.

 + you can change the indentation while you're coding, e. g. when
   the indentation level makes the code exceed the right margin
   of your editor's window,
So what? How many times have you actually done this in the past year? Be honest.

 + you need more keypressing to get through the indentation with
   the spaces, one keypress per space, while you only need one
   keypress per tab (which equals one indentation level),
Not true.  You set up your editor settings to automatically do this for
you.  Most editors have this capability.  On my editor (vim) it only
takes at most one keypress to indent.  You still might use the tab key,
or even have the editor automatically format for you based on syntax.
Editors have done this for decades.  Your objection is specious.

 + per indentation level only 1 byte is needed (tab = ASCII 9), while
   spacing requires more bytes, one per space (space = ASCII 32),
Are you telling me that in an age when most cheap user workstations have
hundreds of gigabytes of disk space, you need this kind of savings?
This is a *very* weak point.

 + while you can convert tabs into spaces, you cannot easily convert
   spaces back into tabs, and finally
Not true.  It is extremely easy to convert both directions.  The unix
'expand' command converts one direction, and 'unexpand' goes the reverse
direction.  These unix utilities have been around as long as 'cat' and 'ls'.

Moreover the whole point is moot anyway.  There are lots of high quality
code formatters available.  One called 'Artistic Style' is well known
and very capable.  On a lot of projects these days, people get sick of
these kinds of arguments and just run all the code they receive through
a code formatter like astyle.  It lets you set all kinds of options such
as brace placement, spacing between parameters, indentation method, and
so on.  If asking people to change their editor settings doesn't work,
this thing fixes it up.

 + even FreeBSD uses the tabbing style.

And therefore if I submit code for FreeBSD then I will use that format.
However I wouldn't recommend it for other projects where that decision
has not been established.

I'm aware that one can argue about where { is to be placed, but
I don't see any valid reason to use spaces for indentation instead
of tabs (which I would even call "standard").

It's a honest question: What are your arguments for using tabs?
Hint: "it is *much* better" doesn't count. :-)

There are lots of cases where it's hard to make code line up the way you
want it with tabs.  Often code that looks good with one tab length
setting (say 8) doesn't look so good with another (say 4).  It gets
especially bad when there are a few space characters thrown in, which
people often do.

-Will


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to