There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Is there merit in sub-dividing code into packages/subroutines even if it is not syntactically needed? Surprisingly little is syntactically necessary. If you want to be pedantic, you really only need to fetch and store bits in memory and do a couple of comparisons. The nice things about subroutines and packages is that they give you, the programmer, short names for things. You could write:
That's a perfectly valid program. It might be the best program to write for your circumstance. It's nice that the comments are there. Look what happens when you use subroutines though:
The compiler doesn't care about the names. The computer really doesn't care about the names. They make quite a difference to me though. I know which program I'd rather maintain. In reply to Re: When Is Dividing Code Into Different Subroutines/Packages Important?
by chromatic
|
|