in reply to Re: Re: Re: Help - I'm a C programmer
in thread Help - I'm a C programmer

For e.g. an event loop (driven my user input), where you have large numbers of entry points into the code, you don't want to handle the passing of the state around everywhere, specially when the state gets large

Was this an example of when to use globals? This is exactly when using globals will come back and bite you a couple weeks/months down the line. If you have a large and complex "state", wrap it up into a meaningful structure; Then you just have to pass around a reference to that structure, which makes passing around a large state very easy.

  • Comment on Re: Re: Re: Re: Help - I'm a C programmer