"When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck."
|--James Whitcomb Riley|
Clear, isn't it? What may not be so clear is that this approach can be used also in computer programming. Yes, even without an actual duck!
Referring to duck typing, Wikipedia gives the following explanation (http://en.wikipedia.org/wiki/Duck_typing).
In computer programming with object-oriented programming languages, duck typing is a style of typing in which an object's methods and properties determine the valid semantics, rather than its inheritance from a particular class or the implementation of an explicit interface.
How can all these concepts be used in everyday programming? ...