BIGpedia.com - Duck typing - Encyclopedia and Dictionary Online
encyclopedia search

Duck typing

Duck typing is a humorous way of describing the type non-checking system typical of some programming languages where, as with Smalltalk, the variable value itself determines what it can do. One could say that the language "ducks" the issue of typing. Initially coined by Dave Thomas in the Ruby community, its premise is that (referring to a value) "if it walks like a duck, and talks like a duck, then it is a duck". Duck typing also refers to the concept in some languages that as long as an object implements a certain interface, it is interchangeable with any other object that implements the same interface, no matter whether the two have a related inhheritance hierarchy.



The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License.
How to see transparent copy

01-04-2007 01:21:04