Skip to main content
1 of 3
Alice
  • 211
  • 1
  • 2
  • 7

Is it a bad idea to create a class which will only have one instance?

Is it bad coding practice/design to make a class which will only be instantiated once?

I have some variables and functions that can be grouped together under a class to "look good" (for a lack of a better description) since they are somewhat related, but they can just be global variables and global functions.

Alice
  • 211
  • 1
  • 2
  • 7