Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: The One True Style of indentation:

by emcs (Scribe)
on Apr 14, 2002 at 03:43 UTC ( [id://158889]=note: print w/replies, xml ) Need Help??


in reply to The One True Style of indentation:

As long as the code is readable, it seems to me that the amount of indentation is largely a matter of personal preference.

As a relative newcomer to perl I appreciate the fact that everything is not cast in stone.

I have noticed that you can sometimes identify an individual by then way they lay out their work; this becomes part of their personal signature.

For better, or for worse.

emcs


The dogs bark; but the caravan rolls on.

Replies are listed 'Best First'.
Re: The One True Style of indentation:
by Anonymous Monk on Apr 20, 2002 at 15:53 UTC
    As long as the code is readable, it seems to me that the amount of indentation is largely a matter of personal preference.

    Sure, as long as you're not trying to work with other people. And you have to work with other people! If you're on a project with several folks, there has to be some agreeable standard or things get messy. If you want to send in patches to an author you have to conform to their indentation style (or lack there-of).

    The real fun comes in that after you've been using K&R one-tab indentation for long enough, other formatting becomes much less readable. When I'm debugging other people's code I find it's faster for me to reformat the code and then debug it. 90% of the time reformatting makes the bugs stand out like fire flies in a cave.

    Using tab indentation and letting people choose the size of their tab stop helps people share code while maintaining some personal freedom of how to look at things.

      Sure, as long as you're not trying to work with other people. And you have to work with other people!


      Thanks Anonymous Monk.

      It seems that I jumped in at the beginning of this thread, with little knowledge of the bigger picture, and a very limited viewpoint.

      However, I learned a lot from reading all the follow up posts.

      emcs

      The dogs bark; but the caravan rolls on.

Re: The One True Style of indentation:
by mikedshelton (Beadle) on Dec 16, 2003 at 00:52 UTC
    Four spaces (1 tab) is my preferred... But working with others (Unix) requires a tab setting of 8... it can be a waste of real estate at times; Other times the two line perl script is my favorite.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://158889]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found