Re:OOP Is Dead, Long Live OOP
by bendavis381 on Thursday October 18, 2018 @04:13PM
(#18251721)
And don’t use a class if it holds no state.
[ Parent
| on HN ]
This 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").