Duck typing


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)

Read Also:

  • Duck-walk

    [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+)

  • Duckweed

    [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 […]

  • Ducky

    [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 […]

  • Ducommun

    [dy-kaw-mœn] /dü kɔˈmœ̃/ noun 1. Élie [ey-lee] /eɪˈli/ (Show IPA), 1833–1906, Swiss author: Nobel Peace Prize 1902.

  • Duct

    [duhkt] /dʌkt/ noun 1. any tube, canal, pipe, or conduit by which a fluid, air, or other substance is conducted or conveyed. 2. Anatomy, Zoology. a tube, canal, or vessel conveying a body fluid, especially a glandular secretion or excretion. 3. Botany. a cavity or vessel formed by elongated cells or by many cells. 4. […]


Disclaimer: Duck typing definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.