Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:03:53+00:00 2026-05-13T07:03:53+00:00

Wikipedia used to say* about duck-typing : In computer programming with object-oriented programming languages,

  • 0

Wikipedia used to say* about duck-typing:

In computer programming with
object-oriented programming languages,
duck typing is a style of dynamic
typing in which an object’s current
set of methods and properties
determines the valid semantics, rather
than its inheritance from a particular
class or implementation of a specific
interface.

(* Ed. note: Since this question was posted, the Wikipedia article has been edited to remove the word “dynamic”.)

It says about structural typing:

A structural type system (or
property-based type system) is a major
class of type system, in which type
compatibility and equivalence are
determined by the type’s structure,
and not through explicit declarations.

It contrasts structural subtyping with duck-typing as so:

[Structural systems] contrasts with
… duck typing, in which only the
part of the structure accessed at
runtime is checked for compatibility.

However, the term duck-typing seems to me at least to intuitively subsume structural sub-typing systems. In fact Wikipedia says:

The name of the concept [duck-typing]
refers to the duck test, attributed to
James Whitcomb Riley which may be phrased as
follows: “when I see a bird that walks
like a duck and swims like a duck and
quacks like a duck, I call that bird a
duck.”

So my question is: why can’t I call structural subtyping duck-typing? Do there even exist dynamically typed languages which can’t also be classified as being duck-typed?

Postscript:

As someone named daydreamdrunk on reddit.com so eloquently put-it “If it compiles like a duck and links like a duck …”

Post-postscript

Many answers seem to be basically just rehashing what I already quoted here, without addressing the deeper question, which is why not use the term duck-typing to cover both dynamic typing and structural sub-typing? If you only want to talk about duck-typing and not structural sub-typing, then just call it what it is: dynamic member lookup. My problem is that nothing about the term duck-typing says to me, this only applies to dynamic languages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:03:53+00:00Added an answer on May 13, 2026 at 7:03 am

    C++ and D templates are a perfect example of duck typing that is not dynamic. It is definitely:

    typing in which an
    object’s current set of methods and
    properties determines the valid
    semantics, rather than its inheritance
    from a particular class or
    implementation of a specific
    interface.

    You don’t explicitly specify an interface that your type must inherit from to instantiate the template. It just needs to have all the features that are used inside the template definition. However, everything gets resolved at compile time, and compiled down to raw, inscrutable hexadecimal numbers. I call this “compile time duck typing”. I’ve written entire libraries from this mindset that implicit template instantiation is compile time duck typing and think it’s one of the most under-appreciated features out there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 291k
  • Answers 291k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer libc is Bionic and malloc is Doug Lea version named… May 13, 2026 at 5:58 pm
  • Editorial Team
    Editorial Team added an answer http://www.alexandre-gomes.com/?p=142 was the best one I found so far... May 13, 2026 at 5:58 pm
  • Editorial Team
    Editorial Team added an answer This is one of the problems with SharePoint development. We… May 13, 2026 at 5:58 pm

Related Questions

Wikipedia has this to say: Total functional programming (also known as strong functional programming,
Recently I have been studying recursion; how to write it, analyze it, etc. I
I'm doing a unit called Data Structures and Algorithms. We've just started and my
my understanding of the entropy formula is that it's used to compute the minimum
I've recently become quite interested in identifying patterns for software scalability testing. Due to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.