Hacker News new | ask | show | jobs
by lmm 1135 days ago
Yep. You've got to remember that Java is nearly 30 years old; at the time making a distinction between interfaces and abstract classes was seen as a radical move. Newer languages have better support for more decoupled ways of doing things, e.g. Rust's use of typeclasses (which it calls traits for some reason) or Kotlin's built-in support for delegation.
1 comments

> Rust's use of typeclasses (which it calls traits for some reason)

Scala and (apparently) PHP call them traits too, among many others [1] -- Rust wasn't the first here.

[1] https://en.wikipedia.org/wiki/Trait_(computer_programming)

The thing that Rust calls traits is quite different from the thing that Scala and PHP call traits, and much more like the thing that many languages call typeclasses.