in reply to Re: how to join these interdependent codes???
in thread how to join these interdependent codes???

I think perlstyle would disagree with you on your style choice. And while Unix was initially developed on paper tape, neither Unix nor C were optimized for or developed on punch cards.

The style you describe as K&R is actually Whitesmiths, but the OP does appear to be using 1TBS (One true brace style), or BSD KNF (Kernel Normal Form) used in BSD Kernel (and most BSD userland) code, K&R is similar but function declarations are more like how you advocate. The indent style you prefer is more like Allman or GNU Style. See Indent_Style for all the details.
I use BSD KNF form even in Perl.

  • Comment on Re^2: how to join these interdependent codes???

Replies are listed 'Best First'.
Re^3: how to join these interdependent codes???
by Marshall (Canon) on Aug 24, 2009 at 17:52 UTC
    And while Unix was initially developed on paper tape, neither Unix nor C were optimized for or developed on punch cards.

    Yeah, it was even worse than punched cards! I didn't expect many folks to remember paper tape days. But yes, these more compact brace styles derive from those ancient days. And in ancient days \t was very common although its rare nowadays (thank goodness). Hard disc space was so expensive that \t got used a lot instead of multiple simple space characters. Now a blank, ' ' is so "cheap" that we should use them without regard to cost (number of bytes).

    Yes, I do advocate lining up curly braces for major functions. I use McCracken style for logic expressions in any language. I don't know a name for the style I use for Perl "stacks" of list orientated functions.

    I have become a disciple of the philosophy that says that the single most important comment that you can put into code is whitespace, be it a blank line or spaces to line things up nicely. Whitespace can separate "thought units" and and also "unite related thoughts into one unit".

    There are a number of ways to indent and space out code. But I think that we would agree that it is important to be consistent in what you do. I suspect that we disagree on what that consistent thing should be. But that that it should be consistent and that "\n" is THE most important comment character is something that I hope we agree upon.

      Definitely, I do not have an aversion to a specific indent style or a religious attachment to a specific style. I just do what works and what is familiar to me (I work almost exclusively with mine and others' 1TBS and BSD KNF indented code, in Perl and C). The only indent style I don't like is no ident or one-line style, heh.