Re: [scala-language] The cake’s problem, dotty des ign and the approach to modularity.
Rex Kerr <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAP_xLa0TMzz7L7p5_p-FHb8+iVr92wWtvxnRnXFFx8X5-GeFgw@mail.gmail.com> |
Well, the idea that you provide the present capabilities and _nothing more_ is not inherent in the idea of OO, even if pragmatically it is the more straightforward approach. But there's no particular reason you can't have the compiler help you out by checking that various invariants or dependencies (computed or specified by the programmer) are followed. You don't _necessarily_ have to manually try to encode that information in types. But doing such things are research-level hard. One can still gain most of the benefits of OO while avoiding most of the drawbacks by exercising a certain amount of discipline in design and documentation. (Also, the idea that traits in Scala don't mix subclassing and subtyping is wrong. Interfaces in Java, before there were default methods, did not mix.) --Rex On Tue, Jun 16, 2015 at 10:41 AM, Raoul Duke <[email protected]> wrote: > > (Unfortunately, due to a lack of a really > > robust way to specify logical dependencies, you often need the source > code > > to the library anyway so you know what is safe to override alone, what > must > > be overridden in pairs, etc.). > > er, hmmm, isn't that part of the larger indictment of inheritance > (subclassing+subtyping all in one)? Vs. e.g. traits, right? That kind > of inheritance seems to be viewed by most folks I think I respect well > enough, to be something basically evil. Maybe a path that seems paved > with good intentions, but turns into a cesspit all too soon. No? > > -- > You received this message because you are subscribed to the Google Groups > "scala-language" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "scala-language" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.