Hi there,
so there is this question whether it’s “good style” to always use override
when implementing abstract members. The advantage is that the compiler will throw an error if you accidentally try to implement a member that doesn’t exist. The big disadvantage IMHO is that the name override
is badly chosen here.
So I wonder what people think of using a different modifier for this, for example implement
:
object StringNoCase extends Ordering[String] {
implement def compare(a: String, b: String): Int =
a.toUpperCase compare b.toUpperCase
}
This makes it more clear, and an additional rule could be that omitting that modifier results in a compiler error, so
object StringNoCase extends Ordering[String] {
def compare(a: String, b: String): Int =
a.toUpperCase compare b.toUpperCase
}
would be forbidden.
Thoughts?