I was just wondering, since the sealed keyword’s existence indicates that it’s the class author’s decision as to whether other classes are allowed to inherit from it, why aren’t classes sealed by default, with some keyword to mark them explicitly as extensible?
I know it’s somewhat different, but access modifiers work this way. With the default being restrictive and fuller access only being granted with the insertion of a keyword.
There’s a large chance that I haven’t thought this through properly, though, so please be humane!
In my opinion there should be no default syntax, that way you always write explicitly what you want. This forces the coder to understand/think more.
If you want a class to be inheritable then you write
otherwise
BTW I think the same should go with access modifiers, disallow default access modifiers.