Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://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":



    • Are you posting in the right place? Check out Where do I post X? to know for sure.
    • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
      <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
    • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
    • Want more info? How to link or How to display code and escape characters are good places to start.
  • Log In?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others examining the Monastery: (4)
    As of 2024-04-25 16:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found