in reply to Re: Re3: : Accessing Other Globals?
in thread Accessing Other Globals?
As for global variables making sense ... Yes, it is theoretically possible that a global variable is the "best" way to design a solution to a given problem. However, it has been my experience (and the experience of every skilled programmer I have ever talked to about this issue) that there has always been a better design solution.
Now, if you're talking about hacking something together really quickly ... sure. Use all the globals you want! But, if you're working on designing something intended for longterm use, especially in OO, you'd have to talk really fast to convince me that globals are the best design solution.
Just so you know, the solution I gave you involved what are called "symbolic references". They are, like globals and goto statements, considered to be almost universally bad. In fact, one monk has (had?) a sig that said you should never use symrefs unless you know why you shouldn't use symrefs. I've used symrefs in production code exactly once. In 6 years of programming Perl. Take that for what it's worth. (I've never needed to use goto in production code, and I've spent weeks encapsulating global variables into Exporter-driven modules.)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re5: Accessing Other Globals?
by chip (Curate) on Dec 15, 2001 at 08:10 UTC | |
|
Re (tilly) 6: Accessing Other Globals?
by tilly (Archbishop) on Dec 15, 2001 at 20:59 UTC |