[vox-tech] global variables in C

Bill Kendrick vox-tech@lists.lugod.org
Fri, 20 Sep 2002 14:24:52 -0700


On Fri, Sep 20, 2002 at 12:56:46PM -0700, Jeff Newmiller wrote:
> 
> I don't expect you to draw it in the wrong position, but do you mean to 
> say you never use offscreen bitmaps?

Confidentially...  No, not really. ;^)  SDL handles double-buffering for you
in most environments.  Tux Paint's another story, but then again, most
of the things I draw onto the canvas (which is displayed within the window)
I NEVER draw _directly_ into the window, and vice-versa.)


> For small programs, a limited number of global variables can be a good
> thing.  Global variables become bad when you begin to reach a certain
> level of complexity, and learning how to get around them without building
> functions that use stupidly long lists of arguments is where skill in
> software engineering starts to show its value.  The steps between here and
> there are small, logical, and compelling... but there are a lot of steps,
> so you will probably only make them when you see their value.

I admit that I'm really not a very skillful software engineer.

My typical coding session begins with starting to code, rather
than thinking much about the design.


Of course, most of what I write are games, and are kind of 'disposable.'
Once I actually finish the project, it's finished, so I don't have to
deal with it much later - there's not much of a problem with scale.

(A few examples come up where scale was a big issue, and I've never finished
the game.  BoboBot and Super Tux come to mind.  But, I vow to one day
complete them!)

-bill!