Orderable vs Ordering

Remi Forax forax at univ-mlv.fr
Thu Feb 5 20:34:10 UTC 2026


Hello,
taking a look to the type-class interfaces in java.lang, 
I think Orderable is not the right name, and will confuse people.

The suffix "able" is usually used to describe the type itself, Iterable, Closeable,
but here what we want is to describe is a witness which is outside and express a relation between two types.

For me, Comparator can be the name of a witness while Comparable can not.

So i'm voting for Ordering instead of "Orderable" but I'm not a native speaker so there is perhaps a better name.

Also if you agree, the following line
  https://github.com/openjdk/valhalla/blob/type-classes/src/java.base/share/classes/java/lang/Orderable.java#L42
should be @see Comparator.

regards,
Rémi


More information about the valhalla-dev mailing list