I know this is a “technically” duplicate of this question. Should I recommend default compaction classes?
But I ask about it again, because the recommendation seems to have changed 1 over time, although I can’t find anything in the last few years about this or that more and more people are now recommending AGAINST compaction classes thanks to testing improvements (which was one of the main reasons), processor speed (the difference in speed is currently negligible), etc.
I am trying to figure out what is the final guideline for the weather or not mark classes as sealed .
1 Essential C # 6.0 (5th Edition) , Mark Michaelis (author Eric Lippert):
“In general, marking a class as sealed is rarely performed and should only be reserved in situations where there are good reasons to favor such a restriction. In fact, leaving open types is becoming increasingly desirable as unit testing has become noticeable due to the need to maintain the layout (test double) object creation instead of real implementations. "
This is solid proof, since all other words are from the mouth.
c # class sealed
Storm
source share