use of a singleton

I've been reading a SDL dev book and came across them using a singleton for the texture manager. This is the first time i have ever heard of it though.

Googling, i came across, where most people say that there is almost always a better way around using a singleton.

My question: I don't understand the point of using it at all? It seems more easier to just use one instance, and "remember" so to speak, or make note, that there is meant to be only once instance alone, instead of going through the trouble of making a singleton.

What are the other alternatives?
The easy thing of singletons is that you automatically get the pointer to the class instance so that your source code gets easier and smaller
People don't like the singletons, because they feel like global variables -and global variables are bad. Singleton is ok if you don't use it as a global access point, but as its purpose - forcing only one instance of class.

As for "easy to use one instance and remember..." - it's easy for you. If you develop framework, other programmers will not know about limitations - and they may do bad things...

Read this:

Topic archived. No new replies allowed.