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.
[duhk-wawk] /ˈdʌkˌwɔk/ verb (used without object) 1. to walk like a duck, as with legs apart and feet turned outward. verb To move forward while squatting on one’s haunches: Maybe that reporter should duck-walk up Olympia ski hill (1930s+)
[duhk-weed] /ˈdʌkˌwid/ noun 1. any plant of the family Lemnaceae, especially of the genus Lemna, comprising small aquatic plants that float free on still water. /ˈdʌkˌwiːd/ noun 1. any of various small stemless aquatic plants of the family Lemnaceae, esp any of the genus Lemna, that have rounded leaves and occur floating on still water […]
[duhk-ee] /ˈdʌk i/ adjective, duckier, duckiest. Informal. 1. fine; excellent; wonderful. 2. darling; charming; cute. [duhk-ee] /ˈdʌk i/ noun, plural duckies. British Slang. 1. (used as a term of endearment or familiarity) dear; sweetheart; darling; pet. /ˈdʌkɪ/ noun (pl) duckies 1. (Brit) darling or dear: used as a term of endearment among women, but now […]
[dy-kaw-mœn] /dü kɔˈmœ̃/ noun 1. Élie [ey-lee] /eɪˈli/ (Show IPA), 1833–1906, Swiss author: Nobel Peace Prize 1902.