http://qs1969.pair.com?node_id=379882


in reply to code execution speed and variable name length

When you invoke a Perl function or operator, you have a function call overhead. I would expect processing time for a 20 character key vs a 2 character key to be small relative to function call overhead.

Meaningful names are good, but don't fall into the Java trap of thinking that a $Variable_with_a_very_long_name is neccesarily more communicative than "$colour".

If you are using multi-layered structures with long-ish names, it can clarify your code if you use aliases, especially if you are doing several operations in one vicinity of the structure:

my $board = $game{'placedtiles'}{$currentuser} $board->{$row}{$col} = ... $board->{$row+1}{$col} =... $board->{$row-1}{$col} = ... $board->{$row}{$col+1} = ... $board->{$row}{$col-1} = ...

--
TTTATCGGTCGTTATATAGATGTTTGCA