[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - trivial programming language



Kai Grossjohann wrote:
> If the middle two lines were indented with a tab, then people could
> view this code with different indentation settings by just frobbing
> the tab width, without changing the file contents.

    Good in theory, bad in practice.  For example, in my Perl code I prefer an
indention of 2 spaces.  Don't ask why, I just do.

if (foo){
  if (bar){
    foreach $foo (@bar){
      while $foo < $baz{
        some really long and convoluted computation here
      }
    }
  }
}

    Now expand that out to someone's preferred 8 per line (ewwwww) and you'll
see that the "some really long and convoluted computation here" is wrapping.
On my screen it looks reasonable, on someone else's it looks like crap.

> The "b" line should start with one tab (for the indentation) and then
> four spaces (for the alignment with the "a" above it).

> I wish that Emacs would allow this style of editing.

    Thank god it doesn't.  That is the worst possible style since tab is
meaningless.  It is because of this mixing of tabs and spaces that people
rigidly say that tabs should never be changed from 8 character widths.  It is
also because of indention and alignment that I think that people should never,
ever, us tabs because there are going to be some schmucks that break the first
rule of never changing the tab width in the first place.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: