all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kai.grossjohann@gmx.net (Kai Großjohann)
Subject: Re: death to tabs
Date: Sat, 05 Apr 2003 22:24:58 +0200	[thread overview]
Message-ID: <84fzowitet.fsf@lucy.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: uadf5sq0z.fsf@att.net

tom.horsley@att.net (Thomas A. Horsley) writes:

> Of course, the true villian in the whole TAB story is the unknown (to me,
> anyway) Prince of Evil who designed the first editor which allowed you to
> change the tab width to be something other than 8, thus removing text
> formatting information from the file, and placing it only in the brain of
> the author (where it is unlikely to be recoverable by those who follow
> after).

Actually, if used right, tabs in source code can be useful.  You
know, some people prefer an indentation offset of 2, some prefer 4,
and still others prefer still other numbers.  If each indentation
level was indicated by a tab char, all those people could have their
preferred viewing experience without changing the file.  If you use
spaces, you impose your preference on the others.

There is a problem of alignment, though.  This needs to be done in a
smart way.  Here's my idea on it.  Look at this code:

if ( a == b ) {
    //-1
    if ( some_long_variable ==
         another_long_variable ) {
        //-2
        do_something();
        do_something_else();
    }
}

I use an offset of 4, as you can see.  The comments mark the
indentation levels.  So the second if statement should be preceded by
one tab.  The "another_long_variable" line should also start with one
tab, then it should have 5 spaces for alignment.  The do_something
lines should start with two tabs each.

If this was the case, then others could take the code and view it
with a different tab-width setting and everything would still look
right.  In particular, some_long_variable and another_long_variable
would still be aligned!

I would really like if this were to happen.  But it's not going to
happen anytime soon, I'm afraid.
-- 
A preposition is not a good thing to end a sentence with.

  parent reply	other threads:[~2003-04-05 20:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 20:23 death to tabs John Russell
2003-04-04 20:30 ` greg jednaszewski
2003-04-04 21:15 ` Bijan Soleymani
2003-04-04 21:37 ` Peter Lee
2003-04-04 23:11 ` Benjamin Rutt
2003-04-04 23:25   ` Bruce Korb
2003-04-05 13:50   ` Roy Smith
2003-04-05 16:35     ` Benjamin Rutt
2003-04-06  5:25   ` Luis O. Silva
     [not found]   ` <mailman.4167.1049606724.21513.help-gnu-emacs@gnu.org>
2003-04-06 17:54     ` Benjamin Rutt
2003-04-05  0:17 ` chris.danx
2003-04-05  1:15   ` Thomas A. Horsley
2003-04-05 13:56     ` Roy Smith
2003-04-05 20:24     ` Kai Großjohann [this message]
2003-04-07 11:36   ` Colin Marquardt
2003-04-05  0:59 ` Thomas A. Horsley
2003-04-07  8:16 ` Stefan Kamphausen
  -- strict thread matches above, loose matches on Subject: below --
2003-04-04 20:48 Sebastien Routier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fzowitet.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.