Re: Variable declaration - C vs script style



markoa wrote:
Hello,

I've been wondering whether there are any differences in performance
when declaring variables within loops
comparing to all forward declarations. I'm mostly writing up to a few
hundred lines long scripts, but I need
relatively a lot variables, which look kind of ugly and IMO make the
script less readable when declared all
at the top. For example,

I would write for legibility, and worry about
performance only when forced.

If the limiting factor in your script
is the GC'ing of local variables,
you have an unusual script :-)

BugBear
.



Relevant Pages

  • Re: crisis Perl
    ... As to writing good code to begin with, ... the top of the script. ... the "use warnings;" line won't actually change ... recommended declaring variables IN AS SMALL AS SCOPE AS POSSIBLE. ...
    (comp.lang.perl.misc)
  • Re: question about eval
    ... Purl Gurl wrote: ... First is declaring a "my" lexical on a global basis only serves ... no need for a final production script. ... I think I was confused about declaring 'my' and 'local' in global scope. ...
    (perl.beginners)
  • Re: Calling a function when the number of parameters isnt known till runtime
    ... I was hoping that declaring user_func as 'void ' would ... scripting language, which is implemented in C and C++. ... I process the script at runtime and I have to call the ... user's C library code. ...
    (comp.lang.c)
  • Re: include_once() within a function
    ... used by the script, so instead of using include or include_once in the ... Ive tried declaring them ... But the real question is - why does it take several seconds to load? ...
    (comp.lang.php)
  • Re: include_once() within a function
    ... used by the script, so instead of using include or include_once in the ... static $cache; ... Ive tried declaring them ... But the real question is - why does it take several seconds to load? ...
    (comp.lang.php)