Personally, I like the 40,000 foot view of things, and I like seeing the 40,000 foot view of things when I'm working on someone else's code. So, I like to see the main logic first. Subroutines, to me, are abbreviations, or replacements. They say "I'm not really an operation, but a link to a series of operations." They're shortcuts, abbreviations, macros, etc. (I'm going to get killed for that statement.)

So, I've got my actual logic flow right there, for everyone to see. It's got a bunch of these 'links' to groups of operations. If I want to see a subroutine definition being used in the top level, I don't want to go far. So, all the top-level subroutines are first, in order of invocation. Then, the next level, etc. At some point, I just start chucking things into modules.

That's just my thought. I understand demerphq's view on things, wanting to remove unintended side-effects. But, in my mind, that's reverting to the shotgun we all want to use. If he feels he needs the shotgun, that's fine. I personally feel that I know what each and every one of my variables do, and where its scope is, so I don't need the shotgun.

I so rarely declare file-scoped lexicals that, when I do, it's for the express purpose of creating a file-scoped global. *gasps from the audience* Globals, just like "goto LABEL", have their purpose. But, that's another node.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.


In reply to Re: where do you put your subs by dragonchild
in thread where do you put your subs by greenFox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.