Programming style, avoiding globals.

Blitz3D Forums/Blitz3D Programming/Programming style, avoiding globals.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hrm.. I thought that globals were allocated in RAM, whereas locals were allocated on the stack.. wouldn't this make locals considerably faster to use? I'm not sure why you would ever want to use lots of globals, really. (Although I could be wrong)

As far as avoiding globals.. well.. not really sure how that can be done without having somewhere else to store the information. (As Strider suggests.. types aren't necessarily required for every little piece of data you need to store.) I *have* heard of people placing literally everything in a type though, so I guess ultimately it's up to what you prefer.