An Ethics Question

Paul Schmidt pjs269 at tijc02.UUCP
Tue Apr 11 01:35:45 AEST 1989


> Global variables or passed parameters?  I'm anxiously awaiting the pros
> and cons of this issue.  Thank you.

There is a proper way of doing global variables in C programming that is
supported by a design methodology.  In the paper "Two-Dimensional Program
Design," by Shmuel Rotenstreich and William E. Howden, in IEEE 
Transactions on Software Engineering, Vol. SE-12, No. 3, March 1986, the
authors describe a modification of structured design techniques that can
be easily implemented in C only by global variables.  They contend that
it is wasteful and more confusing to pass variables from lower level
routines through higher level routines and back to lower level routines
with the higher level routine never using it.

The use of "static" also helps to hide the variables from the higher level
routines so that no higher level routine can ever use these variables.



More information about the Comp.lang.c mailing list