Re-using is actually great, if you haven't force artificial and unnecessary labels on them in the first place —-
say
function bignum_squaring( bigint_input_str,
input_arr,
output_arr,
output_str, ...) {
split( bigint_input_str
into input_arr
by 7-digit chunks)
…… iterate over input_arr chunks and
storing chunked outputs in output_arr ……
…… zero-pad output_arr cells,
sequentially concat them into output_str
return output_str
}
If the function were fed gigantic inputs like a few million digits or more, and bigint_input_str
were simply left in place after the digits were already split into the arrays for chunked processing,
every single time when the kernel is process switching it has to bring all those bytes back in, even though you absolutely don't need it anymore.
But if you don't force labeling them like that and simply use a placeholder variable name like __
, then it's very intuitive to re-use it without having to even write in extra comments detailing how it's recycled (they were only added below for illustrative purposes) :
function bignum_squaring( __, # a bigint
# numeric string
input_arr,
output_arr,...) {
split( input str (__)
into input_arr
by 7-digit chunks)
__ = "" # setting it as zero-length str,
# thus releasing resources being held up
…… iterate over input_arr chunks and
storing chunked outputs in output_arr ……
…… zero-pad output_arr cells,
sequentially concat them into
a temp placeholder string variable (__)
return __
}
So now, __
is being repurposed as the output string instead.
For functions that only accept 1 argument as user input, with a function name that's already crystal clear as to what it performs, e.g. abs()
, floor()
, sqrt()
etc, increased verbosity of the input parameter name doesn't lead to any better user experiences.
Similarly, in the example above, since the function itself is already named bignum_squaring()
, whether one calls it __
or bigint_input_str or even input_then_output_str
doesn't matter as long as the documentation clearly specifies it must be a numeric string type.
i
) – Willard