Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: The One True Style of indentation:

by snafu (Chaplain)
on Apr 15, 2002 at 10:38 UTC ( [id://159210]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to The One True Style of indentation:

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...

  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Node Status?
    node history
    Node Type: note [id://159210]
    help
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Notices?
      hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
      erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.