Skip to content

Rename @maximum and @minimum to @max and @min #12994

@ghost

Description

Every single time I use one of these I want to type "max" or "min" until I remember "ah, right, I can't use well-established abbreviations here; I have to spell it all out, ugh".

The naming choices of @maximum and @minimum are weird and inconsistent for various reasons:

  • "max" and "min" are very well established abbreviations for "maximum" and "minimum"; why do we have to spell it all out like that? It seems so extra.
  • Abbreviations are used all throughout builtin function names. It's inconsistent and makes these two builtin functions stick out for no reason. If we don't want to use abbreviations, I guess we have to rename ptrCast to pointerCast. "Max" or "min" are as much, if not more so, well-understood abbreviation for "maximum" and "minimum" as "ptr" is for "pointer".
  • Every developer expects these to be called "max" and "min". Most libraries/languages etc. use the abbreviations.
  • They didn't do the same mistake in std.math: it's not std.math.maximumInt, it's std.math.maxInt and it's not std.math.maximum, it's std.math.max, and so on.
    So these builtin function names are inconsistent with std.math's equivalents (whatever the difference between these is supposed to be, anyway) as well. Especially if you change between the builtin functions and math.max or math.min, this weirdness in naming becomes especially noticeable and awkward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions