Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: Re: Re: Re: where do you put your subs

by Trimbach (Curate)
on Mar 08, 2002 at 16:16 UTC ( [id://150353]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: where do you put your subs
in thread where do you put your subs

And I think merlyn does it the wrong way. Besides, what merlyn does isn't automatically the right way to do it. Actually, I find much of his code written in an awful style, but I guess he'd say the same when reading my code.
Ah, then that's the point now, isn't it... there's enough difference of opinion that it's hard to say who's "right".
As for the program logic you describe at the end of your post, I've seen real good, and very stylish programs like this:
Yeah, so have I... I really like the block enclosure style, but now we're not talking about subs anymore. The flow of the program is still linear in your example, and is perfectly fine in my book. When you intersperse subroutines in with logic then your program execution stops being linear and becomes non-linear, meaning you're bouncing around all over the place trying to read the dang thing. Not good. And if you're going to bundle your subs with location of use, and wrap the whole thing in a closure, you probably ought to be changing packages, too. ;-D

Gary Blackburn
Trained Killer

  • Comment on Re: Re: Re: Re: Re: Re: where do you put your subs

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found