An Ethics Question

Jeff Ferguson jeff at uop.edu
Fri Apr 7 04:35:43 AEST 1989


	Here's a pretty basic ethics question: how do the mighty C
programmers in netland have to say about global variables?  Take,
for example, the following two pieces of (idiotically simple) code:

/********* Example 1 **********/

FILE *fp;

main()
{
	/* code */
}

readfile()
{
	/* code */
}

/******** End Of Example 1 *********/

/******** Example 2 **********/

main()
{
	FILE *fp;

	/* code */
}

readfile(fp)
{
	/* code */
}

/******* End Of Example 2 ********/

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


--
Jeff Ferguson		       ...!{ucbvax|lll-crg}!ucdavis!uop.edu!jeff
Computer Science Department    ...!cepu!retix!uop.edu!jeff
University of the Pacific      jeff at uop.edu	(209) 944 - 7105

"My father to the left of me, my mother to the right,
 Like everyone else they're pointing, but nowhere feels quite right"
					-- Genesis



More information about the Comp.lang.c mailing list