The term ‘duck typ­ing’ is often used to describe a type of dynamic typ­ing in pro­gram­ming lan­guages where the object’s cur­rent set of meth­ods and prop­er­ties deter­mines the valid semantics.

Why?

duck test — If it looks like a duck, swims like a duck and quacks like a duck, then it prob­a­bly is a duck

Share

2 Responses to “Buzzword Buster – Duck Typing”

  1. […] A pro­gram­ming lan­guage is dynam­i­cally typed if its type check­ing is per­formed at run-time. In dynamic typ­ing, types are asso­ci­ated with val­ues not vari­ables, which means the set of meth­ods and prop­er­ties you can use on a vari­able is ver­i­fied at run­time against the type of the value the vari­able cur­rently holds (see duck typing). […]

  2. […] this code works so long as the ‘+’ oper­a­tor is defined for the run­time types of obj1 and obj2, oth­er­wise, you’ll get a Run­time­BinderEx­cep­tion when this code is exe­cuted. This kind of type check­ing is often referred to as Duck typing. […]

Leave a Reply