in reply to Re: Re: Perl Programming guidlines/rules
in thread Perl Programming guidelines/rules
Simple scalars may often have descriptive names, but I just wrote this:
my $standard={}; # the structure that contains all the standard info # a hasref to # title => "standard title" # dir => standard directory (where the standard +page and graphics are) # des => designation (802.11a-2000) # norm_des => normalized designation (802_11_a_2000) # def => hasref { term => "html definition" }
I found this kind of comment to be immensely useful several month later when I need to fix a bug (rare ;--) or to add features to the code (often!).
And yes, the data represents a view of a standard, hence its name, but there are many infos that can be stored about a standard, it helps to know exactly which one this data structure is providing.
BTW, while I agree that this structure could be an object, I don't think that the specific program I am working on requires OO. And in any case it is nice to have all the docs about the variable right where I declare it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Perl Programming guidlines/rules
by pdcawley (Hermit) on Nov 22, 2002 at 15:02 UTC | |
by mirod (Canon) on Nov 22, 2002 at 15:33 UTC |