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

In reply to Re: Tabs vs Spaces lets give this a go by GrandFather
in thread Tabs vs Spaces lets give this a go by EvanCarroll

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.