Re:An Object-Oriented Language for the '20s
by renox on Saturday March 13, 2021 @05:07PM
(#26450492)
Bah MI was given a bad reputation by Java fans but their arguments weren't very persuasive..
The diamond issue? As shown in the article, it isn't really an issue, Eiffel actually use this solution.
Re:An Object-Oriented Language for the '20s
by andrewflnr on Saturday March 13, 2021 @01:06PM
(#26448480)
The author is explicitly using Kotlin as one of their inspirations, and IMO has a pretty reasonable approach to multiple inheritance (and I suspect they would agree that extension methods are preferred when applicable). What problems does MI cause that aren't fixed by OP's solution to diamond inheritance?
Re:An Object-Oriented Language for the '20s
by thu2111 on Sunday March 14, 2021 @06:46AM
(#26454234)
Kotlin extension methods can't be grouped and abstracted over like traits can. And moreover they are not virtual methods. Virtual methods are useful for all sorts of reasons.
In Kotlin extension methods are best used as a nice way to add utility methods to code you don't directly control, and as part of the 'extension lambda' system that lets you make DSLs. The way Kotlin defines language integration features using methods with magic names makes it easy to add a thin layer on top of a Java API that makes it much nicer to use, without needing to fork or patch the actual library itself.
Re:An Object-Oriented Language for the '20s
by hedora on Saturday March 13, 2021 @12:39PM
(#26448191)
If you want your language to be called “Object Oriented”, it needs to support implementation inheritance. (Encapsulation and interfaces predate OO).
My personal take is that implementation inheritance is a bad idea, and, by extension, Object Oriented programming is a dead end.
The author says there should be no Exceptions and there should be multiple inheritance... I mean, these seem like pretty extreme positions to have when talking about an OO language... if I remember correctly, multiple inheritance, in particular, was one of the features the languages from the late 90's had actually stayed clear of as it had been shown by the previous generation of languages that it was a mostly bad idea. I think even inheritance as done in Java is not the best of ideas, and there seems to be evidence extension methods or, similarly, type classes, are better suited to add behaviour to data structures.
IMO languages like Kotlin and Swift are much more like what modern OOP languages should be than what the author proposes.