good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
eyepopslikeamosquito,
If I were writing it, it would probably look something like:
I think perl's shortcuts can get in the way of writing maintainable code sometimes. For instance, shift can default to two different variables depending on where in the program it appears. If I were to use shift, I would be sure to explicitly state which variable it was acting on. By avoiding shift, adding additional positional variables doesn't require modifying both sides. I know that using _ to avoid another stat call is a nice optimization but I would never do it in production code without a comment. I also prefer the use of constants for array indices so that another author can immediately see what is going on. For the record, I am not a developer and do not write production code so take my comments with a boulder of salt. Cheers - L~R In reply to Re: Practical example of "Is Perl code maintainable"
by Limbic~Region
|
|