Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: poll ideas quest 2015 (declare variables)

by chacham (Prior)
on Oct 27, 2015 at 17:21 UTC ( #1146143=note: print w/replies, xml ) Need Help??


in reply to poll ideas quest 2015

I prefer to declare my variables:

  • At the top of the relevant enclosure
  • At the top of the global enclosure
  • In a separate file
  • Right before their first use
  • Inside their first use
  • I just copy what the code already does
  • Whereever code completion puts it
  • It varies by language
  • It varies by my mood
  • I use one global variable for all my needs
  • Other
  • 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1146143]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2020-10-27 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (256 votes). Check out past polls.

    Notices?