XP is just a number | |
PerlMonks |
Re: Program structure: subs vs modules vs Selfloaderby Anonymous Monk |
on Jun 21, 2004 at 13:10 UTC ( [id://368428]=note: print w/replies, xml ) | Need Help?? |
Looks to me like there isn't much reason to have the subs larger or small in the first place. IMO there are generally two reasons to have a subroutine.
Adding subroutines where there's no clear reason for one just adds confusion to a script. That being said, if you do break things up into subroutines, it's generally good form to ensure that each subroutine does one thing and one thing only. Short and too the point. A run-on subroutine suffers from the same disease as a run-on sentence. I recommend reading Code Complete by Steve McConnell (M$ press). It a very good book on coding style and best practices. Cheers
In Section
Seekers of Perl Wisdom
|
|