Designing to be inherited is extra effort

I saw this rather nice explaination for why sealed is used in so many .Net classes over on cincomsmalltalk.com as a comment to a rant about how .Net is bad for your design skills…

*Designing to be inherited is extra effort

[Shane King] April 16, 2004 20:26:54 EDT*

*It’s extra effort, since you have to think about not only what public interface to provide to users of the class, but also what interface to provide for people who want to inherit your class. Often it’s just not worth putting in that effort. Marking your class as sealed is a way of saying “I didn’t have the time or inclination to ensure that you can inherit this in a reasonable fashion, so I’m not going to let you do it at all”. It’s not telling your users what they should and shouldn’t do as such, it’s admitting you don’t know enough to allow them to inherit, and so not letting them do so. Which is IMO a better decision than letting them do it anyway, and then getting stung when you have to change the class in a way that breaks the classes that inherit from you.

It seems like a resonable position, but personally I’d prefer it if sealed were just advisory and the user could decide to go against the designer’s wishes if they wanted to try their luck…