5 ms·
I think that the author misses an understanding of the few concepts, or at least one. This is separation of the concerns. Even if, as author thinks, that idea
by eveningcoffee 12y ago
I think that the author misses an understanding of the few concepts, or at least one. This is separation of the concerns.
Even if, as author thinks, that idea of the interface was invented by accidence, it is a good invention.
Because it allows us to clearly to separate the abstract concept from its implementation(s).
Even if Java had multiple inheritance, it should have had also the interfaces to be able to become the usable language it is today.
While interface would allow us to simulate the multiple inheritance, its main benefit is clearly wider.
- the_af 12y agoDisclaimer: the article is by Uncle Bob, whose articles I find harder and harder to read. If nothing else, the condescension in some of them is very annoying. I can't say I respect the guy. That said, > Even if Java had multiple inheritance, it should have had also the interfaces to be able to become the usable language it is today. I have a problem with this assertion. I don't think Java-like interfaces are required for an OOP language to be usable. What about other OOP languages that don't have them, like for example Scala?
- eveningcoffee 12y agoScala has one out of the sight interface: interface Function { call(...); }. // of course this is a made up syntax. For most of the cases, this is just enough (as it is also in Java).
- the_af 12y agoI'm sorry, I don't understand your comment. Can you clarify what you mean, using actual Scala syntax if possible? (Just so I understand). In any case, my point is that since there are usable OOP languages without Java-like interfaces, this kind of interfaces isn't necessary. That is, there are alternative ways of producing usable OOP languages. It doesn't necessarily follow that Java is successful because of its implementation of interfaces.
- eveningcoffee 12y agoMy point was that, as functions are treated as objects in Scala, you actually have a hidden one method interface behind each function implementation.
- the_af 12y agoFunctions are implemented as objects in Scala, but this is an implementation detail. Scala implemented over something else than the JVM could have done first-class functions differently. Also, the notion of "interface" we're discussing here (and Uncle Bob is railing against) is the Java-like interface (i.e. using the actual "interface" keyword that disallows implementation, and not abstract classes). Those are not used in Scala. Therefore, they are not required for successful OOP languages. Note I think Uncle Bob's condescending tone in TFA is pretty useless. The entire article consists of building a strawman. He really annoys me.
- eveningcoffee 12y agoYou can see this as an implementation detail or also as a conceptual detail.
- the_af 12y agoI don't think it's conceptual. It's a technical detail. If they had been implemented differently, this would have made little difference to the programmer using Scala. Again, Objects aren't Java interfaces, so I guess the whole discussion is moot :)
- eveningcoffee 12y agoYes, this is conceptual as you can conceptually regard functions as objects and it may have great benefits as a tool to communicate the idea to the other people. There are of course other abstractions with their own benefits.