Re: buf[]

From: Edward Almasy (almasy@axis.com)
Date: 09/14/95


Jeremy Elson writes:
> The second reason, and one that's still valid IMHO, is that it's more
> convenient to have buffers around without declaring them, since all
> functions use them anyway.

This is an open invitation to all sorts of problems, though.  For
example:

- You might change the value of a global buffer in one place and
mistakenly think that it has remained unchanged somewhere else.

- A global buffer may be passed to a routine as a parameter and also
used directly by that routine.  (The exciting and interesting weird
behaviors that this one can generate are endless. :-) )

- You might think you're using a global buffer when in fact you're
using another variable with the same name that has been declared in
a smaller scope.  Or vice versa.

In other words, if tracking down bizarre and convoluted bugs is
one of the things you love most about writing software, add as many
of those global puppies as you can cram in!!  ;-)


 \_\_\_     _/ \_\_\_  axis data: specializing in online system setup & design
 \_  \_     _/ \_  \_    Edward Almasy                       almasy@axis.com  
 \_\_\_     _/ \_\_\_    President: Axis Data   Proprietor: NineJackNine BBS
     \_ _/  _/     \_    608-256-5732 (voice)            608-256-5697 (data)
 \_\_\_ _/_/_/ \_\_\_  9jack9: on the bleeding edges of culture and technology



This archive was generated by hypermail 2b30 : 12/07/00 PST