3 ms·
>Can we get rid of 'sealed'? I really hate that keyword. Sometimes there's a good reason for it, sure, but sometimes it's used gratuitously, and then I have to
by jasode 6y ago
>Can we get rid of 'sealed'? I really hate that keyword. Sometimes there's a good reason for it, sure, but sometimes it's used gratuitously, and then I have to work around it for no good reason.
Fyi... this stackoverflow Q&A has opinions on why 'sealed' is a rational default for the person who designed the class:
https://stackoverflow.com/questions/268251/why-seal-a-class/ https://stackoverflow.com/questions/268251/why-seal-a-class/
It doesn't mean the programmer thinks the base class is "perfect". Instead, the author has not deliberately designed the particular class for inheritance and the "sealed" keyword expresses that.
- dale_glass 6y agoYes, I know there are good reasons to do it sometimes, but still don't get what about SqlDataReader benefits from it, other than "I don't know why would anyone would want to inherit from it". Looks like my issue with that got fixed with extension methods, which should let me tack on such improvements whether the original designer of the class thought that would be a good idea or not.