Re: working example File::Taill

From: Uri Guttman (uri_at_stemsystems.com)
Date: 03/22/04


Date: Mon, 22 Mar 2004 14:34:36 GMT


>>>>> "A" == Abhinav <Me@myco.com> writes:

  A> Couldnt this be a disadvantage in big projects, where declaring
  A> criables at the top of the appropriate scope allows ppl to find *all*
  A> the variabled in that *unit* in a single place, rather than strewn all
  A> across .. ?

why would you want to see all the variables in one place? they are out
of context and many are in the wrong scope. use scoping at the primary
reason not to do this. then simplicity of code as the second.

how about this reason i just saw recently? i rewrote a module that had
all the variables declared at the top. and i found some that weren't
used any more. if they had been delcare when first used and then deleted
you wouldn't have that problem.

  A> I understand this is a matter of style ..but still .. any inputs/comments ?

it is style sure, but the strong consensus is that it is poor style.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


Relevant Pages

  • Re: working example File::Taill
    ... Uri Guttman wrote: ... > A> Couldnt this be a disadvantage in big projects, where declaring ... > of context and many are in the wrong scope. ... > reason not to do this. ...
    (comp.lang.perl.misc)
  • Re: Is VB Caca??
    ... It warns you because you are declaring a variable in the scope that hides a variable with the same name with a larger scope. ... Mike Ober. ... Dim s As String ...
    (microsoft.public.dotnet.languages.vb)
  • Untold(...) variable scope in ASP.NET
    ... We all know that declaring a variable as 'Public' gives it global ... scope over the application, nothing new... ... I usually dont like to create session variable because i found them ... scope goes beyong the user session, actually you are better off using ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Why force a connection string scope to be application?
    ... Im not interested in the way "you" use connection strings. ... If anyone else knows a "technical" reason why connection strings are ... Because you want something slightly out of the scope of what Visual ... making Chicken Salad out of Chicken s**t. ...
    (microsoft.public.dotnet.framework)
  • Re: rs232 thermometer
    ... The reason that i am asking is that this is my first EVER attempt at ... I have tested the circuit using a volt meter and i get the correct ... and SCA lines to see if you are getting reasonable signals to the ... to display something if you don't have access to a storage scope. ...
    (sci.electronics.basics)