Responds to certainly has its place, but you want to favor polymorphism first.
Say you need to move some animals around but some of the animals are
fish and some are birds.
You might have client code that looks like this (but it would be bad)
anAnimal respondsTo: #swim ifTrue: [anAnimal swim] if
Is it considered bad practice to use #respondsTo:? If so, why?
Lint flags it as a "questionable" message.
Thanks - Sophie
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners