In computer programming with object-oriented programming languages, duck typing is a way to write computer code. It doesn't demand that you know what types you are writing about. If it does what you thought it would do, it is good enough. The reason this is called "duck typing" is the duck test.
- 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.
References[change | change source]
- Heim, Michael (2007). Exploring Indiana Highways. Exploring America's Highway. pp. 68. ISBN 978-0-9744358-3-1. https://books.google.com/books?id=j7zds6xx7S0C&pg=PA68&dq=%22james+Riley%22+OR+%22James+Whitcomb+Riley%22+bird++duck&num=100.