in reply to Re: Coding style: truth of variable name (subroutine length)
in thread Coding style: truth of variable name
My subroutines can range from just a few lines to over several hundred lines long. Labelled blocks sometimes help in making long subroutine clearer, as well as creating lexical scope to isolate the effect of variables.
sub do_some_task { my ($arg1, $arg2, $arg3) = @_; SUBTASK1: { my $some_var = ... ... ... ... } ... SUBTASK2: { ... ... ... ... ... ... } ... ... }
I do have to question your claim. What makes variable names much less important than subroutine names? Variables are referred to much more often.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Coding style: truth of variable name (subroutine length)
by Anonymous Monk on Apr 19, 2020 at 10:01 UTC |