The Stack Overflow podcast is back! Listen to an interview with our new CEO.
1 of 4

Are there any OO languages without inheritance?

During a code review today, a colleague of mine said something interesting about Javascript:

prototype is only useful when you need inheritance - and when's inheritance ever a good idea?

I thought about this and I realised that I usually use inheritance to get around code that was badly designed in the first place. Modern OO style prefers composition over inheritance, but I don't know of any languages which actually enforce this style.

Are there any general-purpose programming languages with classes, objects, methods, interfaces, and so on, which disallow class-based inheritance? (If such an idea doesn't make sense, why not?)