3 ms·
And don’t use a class if it holds no state.
by bendavis381 8y ago
And don’t use a class if it holds no state.
- Ace17 8y agoThis is not so simple. What about "NullLogSink" and "StdoutLogSink", both being implementations of "ILogSink"? Classes are very well suited to statically formalize the communication points (aka "interfaces", "protocols") between the various parts of your program. The fact that a concrete class might have a state is actually irrelevant (indeed, we generally make all of our data members "private").