What is the difference between Ordering.by() and Ordering.on() in Scala?
(Well, one is defined in the trait and the other in the companion object, and the implementation code is also different, but there must be a reason why the language needs both.)
From the documentation of
Ordering.by:Basically the two are the same, it's just a matter of convenience depending of what is your context and what you're working with.