(singleton = global variable)?
It is global state that is a problem, not just global variables. And yes, singletons are also global state. So you win nothing by using a singleton over a global variable.
So you have several options: you can understand why global state is bad, and still decide to use it. Or you can go the OO route where the database handle is available.
In reply to Re: Global or not global
by moritz
in thread Global or not global
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |