SPUG: MORE INFO: Array Naming Question

Chris Wilkes cwilkes-spug at ladro.com
Wed Feb 4 12:33:47 CST 2004


> --- "North, Walter" <wnorth at state.mt.us> wrote:
> > 
> > Dan:
> > 
> > >>>>>>>Blinding Flash of Light<<<<<<<<<
> > 
> > Sometimes the obvious is just too
> > obvious.............
> > 
> > Its the key stupid, not the hash name...........
> > 
> > Thank you.
> > 
> > Also Chris Wilkes for the thought on creating my own
> > perl module.  That is definately one I had not
> > thought of.
> > 
> > Perhaps as my skills increase........
On Wed, Feb 04, 2004 at 10:00:58AM -0800, Brian Maddux wrote:
> I would suggest getting the Advanced Perl Programming
> book from O'Reilly. It really helps with hashes,
> references, etc.

Also look into picking up Damian Conway's book "Object Oriented Perl":
   http://www.amazon.com/exec/obidos/tg/detail/-/1884777791
which is both witty and informative.

What I like to do is look at my code and think "6 months down the road
am I going to remember that $info{name}{date} is the purchase date?" and
the answer is usually no.  Or "If someone else took over this project
can they easily extend what I've done?" -- if all you have are one off
scripts then no.

When you start writing modules you might think that you're doing a lot
of work for little gain.  Why am I writing all these getters and setters
when it took me 2 seconds to think up $info{name}{date}?  Keep reminding
yourself that you *read* code 100x more often then you *write* it.  So
if it takes you an hour to write a good module it will pay off in the
long run as you don't have to keep on remembering what data structures
you were using.

Good luck!

Chris



More information about the spug-list mailing list