http://www.perlmonks.org?node_id=1146143


in reply to poll ideas quest 2015

I prefer to declare my variables:

  • Comment on Re: poll ideas quest 2015 (declare variables)

Replies are listed 'Best First'.
Re^2: poll ideas quest 2015 (declare variables)
by stevieb (Canon) on Oct 27, 2015 at 18:21 UTC
    • with names that are concise and relevant
    • with names that are obscure and confusing for security's sake
Re^2: poll ideas quest 2015 (declare variables)
by Anonymous Monk on Oct 27, 2015 at 22:26 UTC

    It should be a multiple-selection as I "declare my variables" ...

    • At the top of the relevant enclosure: before option handling; keeping value after a loop;
    • Right before their first use: for my $x = 1 if $test is buggy; no other way (search in loop; populating array or hash);
    • Inside their first use: preferred
    • I just copy what the code already does: in maintenance mode;
    • It varies by language: C, C++, SQL