in reply to Tabs vs Spaces lets give this a go

Tab characters should never be used in source code. They are far too prone to being abused. Traditionally a tab character was 8 spaces wide. Almost no one uses 8 character indents so a common convention is to set the expansion width of tab characters in editors to the indent width currently being used. After a little editing some of the indent tabs will turn into spaces. After that all hell breaks loose when you share the code with a friend or workmate.

At least space indented code is presented in similar fashion by virtually all rendering systems. That is not true at all for tab indented code.

If you have a real need to alter the indentation of space indented code use a pretty printer appropriate to the language it is written in. If there isn't one available you could pretty quickly write a Perl script to figure out the indent quanta and change it to your preferred size.

Remember the golden rule - never use tabs for indentation.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Tabs vs Spaces lets give this a go
by fergal (Chaplain) on Oct 08, 2006 at 22:24 UTC
    Tab characters should never be used in source code. They are far too prone to being abused.

    Perl is also prone to being abused, should we swich to python?

    :-)
    Remember the golden rule - never use tabs for indentation.

    The golden rule is never mix the twp and everyone is happy.

      No. Perl is abused in amusing and educational ways. Python uses indentation in obscene ways that exacerbate the tab issue beyond reason. :-)

      Actually the golden rule is: "He who has the gold rules". All Evan actually has to do is get enough money then he can pay everyone to follow his style guidelines and have shot anyone who doesn't.


      DWIM is Perl's answer to Gödel
A reply falls below the community's threshold of quality. You may see it by logging in.