I love the Socratic method the article is written in! Good job.
Of course, one always needs to find a balance. I could almost argue that one should never have utility classes, because static methods are evil. Just the same, singletons are evil because they also cannot really be extended very easily. Everything should be generated in a factory. But for many utilities, that is overkill.
I thank the author for the idea of throwing an exception in the private constructor. While I don't think I create an instance of a utility class not meant to be instantiated from within the utility class itself, I may be mistaken. I'm a human, after all, and therefore I make mistakes.
Comments
htowninsomniac replied ago:
I love the Socratic method the article is written in! Good job.
Of course, one always needs to find a balance. I could almost argue that one should never have utility classes, because static methods are evil. Just the same, singletons are evil because they also cannot really be extended very easily. Everything should be generated in a factory. But for many utilities, that is overkill.
I thank the author for the idea of throwing an exception in the private constructor. While I don't think I create an instance of a utility class not meant to be instantiated from within the utility class itself, I may be mistaken. I'm a human, after all, and therefore I make mistakes.
Voters For This Link (20)
Voters Against This Link (5)