Skip to content

Consider speciesist language in documentation #3516

@stuckvgn

Description

@stuckvgn

Summary

The TypeScript documentation uses the term "duck typing" in two places when describing TypeScript's structural type system. While this is a widely-used computer science term, it derives from the "duck test" idiom ("If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck"), which instrumentalizes animals as metaphorical objects rather than sentient beings. The TypeScript docs already use the preferred alternative — "structural typing" — alongside it, making the transition straightforward.

Instances found

1. packages/documentation/copy/en/get-started/TS for JS Programmers.md (line 211)

One of TypeScript's core principles is that type checking focuses on the shape that values have. This is sometimes called "duck typing" or "structural typing".

2. packages/documentation/copy/en/handbook-v1/Interfaces.md (line 13)

This is sometimes called "duck typing" or "structural subtyping".

Additional context

The compiler test suite also contains duck-types and duckquack references in test fixtures (src/testRunner/unittests/helpers/typingsInstaller.ts, src/testRunner/unittests/tsserver/projects.ts), though these are not user-facing documentation.

The documentation already heavily uses "structural typing" and "structural subtyping" as the primary terminology throughout the handbook, making "duck typing" redundant in these contexts. Removing or replacing it would not reduce clarity — the concept is fully explained by the structural typing terminology that already accompanies it.

Suggested change

Replace the two documentation instances with language that relies solely on "structural typing" / "structural subtyping", which the docs already use as the primary terminology. For example:

TS for JS Programmers.md:

One of TypeScript's core principles is that type checking focuses on the shape that values have. This is sometimes called "structural typing".

Interfaces.md:

This is sometimes called "structural subtyping".

Why this matters

Speciesist language in tech normalizes the treatment of animals as objects or tools. Terms like "duck typing" derive from idioms that use animals instrumentally. As the tech industry has moved toward more inclusive language in other areas (e.g., replacing "master/slave," "whitelist/blacklist"), reconsidering animal-derived idioms is a natural extension of that effort.

TypeScript's documentation is read by millions of developers worldwide. Small language choices at this scale have meaningful cultural impact.

Happy to submit a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions