[Newbies] is* methods
blake at loadedshelf.com
Fri Jan 25 09:40:25 UTC 2008
While wandering through the (hefty) base Object class, I came across the
is* methods, which I had of course used many times.
They're very convenient.
But are they, well, stupid? Something like 40 methods that all return
false and are overridden by one class somewhere in the hierarchy? Wouldn't
their purpose be better served by a single method, like:
^(self class) inheritsFrom: Class
which would never have to be overridden? Obviously there are some is*
methods that server a larger purpose but isn't more...polymorphic...to say
and then add "isSomeNewClass" when you need it?
More information about the Beginners