Quote:
Originally Posted by BradAMiller
We thought that it was easier to use the CommandBase class. What happened was that I did a presentation on the command based programming style and found myself spending 10 minutes explaining about singletons and static variables. And the code looked much cleaner if you just can reference the subsystem class instances with a simple variable. So either works, but we thought it was cleaner to not use all the static variables - and the subsystems themselves, often only a few lines of non-boilerplate code, got much smaller.
Brad
|
Aside from the conceptual difficulty of singletons and static variables, are there any reasons not to use singletons? I can see the private constructor being useful in the way of "I instantiated the chassis, why is it throwing a PWM already allocated exception (or whatever)?"
- Oliver