jk2addict has asked for the wisdom of the Perl Monks concerning the following question:
I'm not sure thie is really an abstraction issue, but here goes.
While working on a new project, I've noticed myself using the same hash key's over and over in a set of modules, and one thing is starting to bug me: what if I need to change those keys later, either due to programming flaws or just namespace preferences?
So, I was thinking of globalizing these key names, either lexically in each module, or globally in a Constants module. Is this just overkill for the most part, ala Going To Far? Are there any drawbacks to doing this? I don't tend to see a lot of this in current modules, so is there something I don't know?
In web design, I tend to make all my key names of name/value pairs constants for querystrings and form elements for the same reason. If I need to change the name of one later, it's in one place, so I guess this is behaviour is wanting to rub off into my Perl life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Abstraction: Has far is to far?
by jeffa (Bishop) on Aug 26, 2002 at 14:36 UTC | |
by jk2addict (Chaplain) on Aug 26, 2002 at 15:22 UTC | |
|
Re: Abstraction: Has far is to far?
by perrin (Chancellor) on Aug 26, 2002 at 14:34 UTC |