Re: MODULEand USE versus Argument Passing



glen herrmannsfeldt wrote:
> E. Robert Tisdale wrote:
>
> (snip)
>
>> Global variables are *always* a bad idea.
>> Never pass function arguments through modules or common storage.
>
> There is an old saying that goes something like "All generalizations
> are bad, including this one."
>
> I would agree that global variables are often overused.
> There are cases where the whole program revolves around certain
> variables, usually arrays. In those cases, it sometimes makes
> sense. [...]

More to the point, it is often the case that several procedures need
to share access to some common data, but the procedures that *call*
this set need no such access. Requiring the data to be passed as
arguments requires that the callers not only access, but declare
those shared data. Pollution of namespace is dangerous, verbose,
and counter-productive.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.