isComplex name is bad

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

isComplex name is bad

Nicolas Cellier-3
I do not like the name Complex.
I would prefer ComplexNumber.

Why ? see implementors of isComplex. There are several ones.

The meaning of the message is (isKindOf: Complex) in Object and in Complex.
But it has other meaning elsewhere (like is something complicated).
And some class can be complicated but not KindOf: Complex...

a better message would be isComplexNumber as stated in this comment:
Object>>isComplex
 "Answer true if receiver is a Complex number. False by default."

 ^ false

That does not matter, these classes won't ever mix might you say.
Imagine i want to implement some ComplexMatrix.
Shouldn't it answer true to isComplex ?
Then i will do arithmetic with ComplexNumber and this will fail because both
class will mis-interpret isComplex as being ComplexNumber or ComplexMatrix...

The right names are definitely isComplexNumber and isComplexMatrix.

Who has the authority and the will to change that ?