0,02 ...
Enabling inheritance for a class allows people to cope with unforeseen problems. (for example, monkeypatching, which is often found in RoR. It may be ugly, but it is a reality against pedantry). Having said that, I am not a big fan of gratuitous inheritance. The relationship between the base and subclasses can be fragile. Deep hierarchies of inheritance are hard to find.
In one case, I can think of prohibiting inheritance - it is forced immutability. This is important for things like the Java String class.
seand source
share