Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
In vim:

set sw=4 set expandtab
An excellent solution for tab-to-4 spaces without the actual \t. I luuuub vim

Update:
tab'ing is fine only if:

  • 1. Your editor replaces your \t with spaces so that your code has readability in more than one editor. Ever tried reading your code in vim after writing it in vi?
  • 2. You don't tab out to 8 spaces! That is just ludricous. Editor line wrapping is retarted looking. So, if you have code that spans out over more than 4 or 5 tabs you either have to do something like:

    code { code{ code { code { code { # Lots of tabs out to here... +must be taking a lot of space so far so you use the cat operator to k +eep from line wrapping but hey...this comment is really long and man, + I just hate line wrapping. my $line = "this is a". "line that won't". "line wrap.\n"; } } } } }
    But this kind of thing is just crazy when it can easily be avoided by simply not taking up so much space with tabstops (generally set at 8). You get just as much readability out of 4, 3 or sometimes even 2 space tabs (Im using the term 'tab' loosely here). But, I guess its all persona, therefore, Im just saying that, imo, tabs so large are just ridiculous and the use of 'tab' as a real tab is not wide or respectful to the maintainers of your code after you're done.

    I mean really! Is the following code any less readable than the above?

    code { code{ code { code { code { # and of course, I would fix my # comment too. my $line = "this is a line that won't". " line wrap.\n"; } } } } }

    _ _ _ _ _ _ _ _ _ _
    - Jim
    Insert clever comment here...


    In reply to Re: The One True Style of indentation: by snafu
    in thread The One True Style of indentation: by Petruchio

    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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (8)
    As of 2014-09-16 04:59 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (156 votes), past polls