On Feb 26, 2004, at 11:47 AM, B McKee wrote:

Hi All,

I'm slowly creating my Perl Masterpiece (tm)
I'll let ya all giggle over it when I'm done :-)
At any rate - It's done what I believe you call "top-down".
I declare the subs, then have the code for the main program,
then the subroutine code blocks.
My question is what order should the subroutines appear in?
Alphabetical? Order of appearance? Rough grouping by function?
The fact that some subroutines may or may not call other subroutines
and some of the subs are called by pretty much all the other subs
makes it hard for me to decide what order would make it easiest to read.
What's the 'standard'?

I believe this is all pretty matter of opinion stuff.


I have a habit of writing them in alphabetical order. I tell myself it's so I always know where what I'm looking for is.

Ready for the punch line?

When I really want to jump straight to one of my subroutines, I use my editor's "Function Pop-up Menu", which takes me right to it, no matter where it is. It gets worse though. If I hold the Shift key when I bring it up, it shows them in alphabetical order. Doh! So much for logic.

Use whatever makes sense to you. There's no right or wrong answer.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to