[comp.lang.c] It heard the word \"power\" and res

mcdonald@uxe.cso.uiuc.edu (01/25/88)

>The possibility of disagreement in the COMMON variables among FORTRAN
>subprograms is a frequent cause of bugs.

About as frequent as putting the wrong variable in a argument list.

>If you want to do something analogous in C, you can use an extern
>structure to package the data under a single visible name.

True, and it is at least as flexible. 

>Actually, inter-module communication via global data is contrary to
>well-established structured design principles.  It should be used
>sparingly or not at all.

Bullshit. Inter-module communication via global data is probably the most
potent method (to the programmer, not internal to a compiler) available
for both space and time optimization. Particularly space. (As an aside,
I sometimes find it useful in C to pass to subroutines a pointer to a
structure containing pointers to each of the variables needed. This saves
all those instructions needed to push variables on the stack, and is
the usual method employed in Fortran. It is useful only when you need
to call one subroutine many times with one or a few different lists of data.
All these pointers are of course compiled in.)

Doug McDonald