5 ms·
Agree and disagree. As often is the case, once you make an abstract concept concrete in the codebase it gets distorted and exploited. "Keyword interfaces" as yo
by tel 6y ago
Agree and disagree. As often is the case, once you make an abstract concept concrete in the codebase it gets distorted and exploited. "Keyword interfaces" as you helpfully define here are a prime example. They are not 1-to-1 with genuine "interfaces" as one would like to discuss.
More than just the declaration of functions and methods, though, is the way that those functions are known to interact! Consequentially, an interface may infect another interface, at least abstractly.
In contrast to what I just said above, I think OCaml has a fantastic "keyword" implementation of interfaces. The whole language is built around it. It's not perfect (there's no way to specify the "laws" between interface elements) but it treats composition of interfaces as a very first class idea. I find myself recommending it all the time.