Re: MODULEand USE versus Argument Passing



E. Robert Tisdale wrote:

Global variables are *always* a bad idea.
Never pass function arguments through modules or common storage.

<snip>

If your subprogram has more than a few arguments,
you probably have a design problem.

*Never* using global variables sounds like a good way to end up with very lengthy argument lists. For example, I'd probably prefer to put physical constants in a MODULE, and USE it when necessary, rather than pass them all as arguments when ever a procedure (or one of its child procedures) might need them.


For the particular problem presented, I would agree that arguments are the way to go. But your first sentence is far too sweeping.

Richard
.



Relevant Pages

  • Design question
    ... I've got a design problem I'm hoping you can help me with. ... I have two almost identical lists that I'd like to generalize into one class rather than having two almost identical. ... Say for instance I have a list class of people and a list of animals. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Help With Query
    ... in general storing a list in a single column indicates a ... design problem, so you might want to look again at your implementation. ... This article has more information about handling delimited lists: ...
    (comp.databases.ms-sqlserver)