Singleton : Fields vs Globals

BlitzMax Forums/BlitzMax Programming/Singleton : Fields vs 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.

Well, you can access globals from other parts of the program without referencing to (or knowing about) any instance of the type. If you have a singleton type, you can always declare the type instance itself as global, so I guess it really makes no difference.

Performance-wise, I'm under the impression that only true program globals are significantly faster to use and access than local variables, and globals inside types aren't. So there's really no performance gain in using globals within type.