Skip to content

Inconsistent singular vs. plural unit naming in generated factories #49

@matt-edmondson

Description

@matt-edmondson

Summary

Generated From{Unit} factories mix singular and plural forms across dimensions, which is jarring for consumers and inconsistent with the documented API surface.

Evidence

From Semantics.Quantities/Generated/.../*.g.cs:

File Generated factory
Mass.g.cs FromKilogram (singular)
Force1D.g.cs FromNewton (singular)
Distance.g.cs FromMeter (singular)
Diameter.g.cs FromMeter (singular)
Airspeed.g.cs FromMetersPerSecond (plural)
Acceleration1D.g.cs FromMetersPerSecondSquared (plural)
AngularMomentum1D.g.cs FromKilogramMeterSquaredPerSecond (singular composite)

Meanwhile the strategy doc (docs/strategy-unified-vector-quantities.md) advertises Speed.FromMetersPerSecond(...) and Force1D.FromNewtons(...) (plural).

Impact

  • API surface differs from documentation.
  • Calling code must guess which form a given unit uses.

Suggested next step

Pick a single convention (recommended: plural for all units, since most values are quantities) and update the unit metadata / generator so every emitted factory uses it. Add a unit test (or generator snapshot) that asserts the convention across all generated quantities.

Area / Severity

SourceGenerators · cleanup

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions