duck typing

Computing Dictionary

duck typing definition

programming
A term coined by Dave Thomas for a kind of dynamic typing typical of some programming languages, such as Smalltalk, Ruby or Visual FoxPro, where a variable's run-time value determines the operations that can be performed on it.
The term comes from the "duck test": if it walks like a duck and quacks like a duck, it must be a duck.
Duck typing considers the methods to which a value responds and the attributes it posesses rather than its relationship to a type hierarchy. This encourages greater polymorphism because types are enforced as late as possible.
(http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/100511).
(2006-09-13)
The Free On-line Dictionary of Computing, © Denis Howe 2010 http://foldoc.org
Cite This Source
Explore Dictionary.com
Previous Definition: duck the rock
Next Definition: duck walk
Words Near: duck typing
More from Thesaurus.com
Synonyms and Antonyms for duck typing
More from Reference.com
Search for articles containing duck typing
More from Dictionary.com Translator
Dictionary.com Word FAQs

Dictionary.com presents 366 FAQs, incorporating some of the frequently asked questions from the past with newer queries.

Copyright © 2014 Dictionary.com, LLC. All rights reserved.
  • Please Login or Sign Up to use the Recent Searches feature