Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: The One True Style of indentation:

by FoxtrotUniform (Prior)
on Apr 15, 2002 at 17:39 UTC ( #159279=note: print w/replies, xml ) Need Help??

in reply to The One True Style of indentation:

I code to a rather strict interpretation of K&R style, but I use two-column indents instead of eight- columns, mostly to conserve screen real estate. (And of course I cuddle my elses!)

    Update: Cuddled elses are:
    if(foo) { ... } else { ... }
    whereas perlstyle, IIRC, recommends:
    if(foo) { ... } else { ... }

Another thing: I try to keep my line lengths below 72 columns. This keeps it easy to read even when you're editing it on the server console (don't ask), with vi in line-numbering mode. (And if a line's longer than 72 columns, it's probably malformed anyway.)

I used to be vehemently anti-1TBS, citing all the usual arguments about braces getting lost and code being cluttered and hard to read. Then I took a course from a prof who used 1TBS all the time, and it just clicked. (Sort of like the way I started out using Emacs, and switched to vi.)

Good luck, tilly

Replies are listed 'Best First'.
Re: (FoxUni) Re: The One True Style of indentation:
by snafu (Chaplain) on Apr 15, 2002 at 19:25 UTC
    Yes. Screen real estate is very important to me too. I love the concatenation operater for this purpose.

    I could get use to 1-TBS but I don't want to :) This is the beautiful thing about coding is that its very personal and distinct. Its like literature. No two people code the same nor do any two people write literature the same.

    Holy (programming) wars are fun to argue about but they are really useless. Btw, cuddled elses...are they the

    condition () { more code }


    condition () { more code }
    I like the second but I admit that the first is growing on me. This is a topic in-and-of-itself for a holy war. :) I think I see the next vote topic! =P jk

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://159279]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-06-19 03:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.