Implemented this for the next release: https://feedback.objo.dev/feature/1240
Thanks for the suggestion. The standard library now standardises on MinValue and MaxValue as the shared-property names.
What changed
Integer.MinValue and Integer.MaxValue - added as the canonical names.
Double.MinValue and Double.MaxValue - added as the canonical names.
DateTime.MaxValue - added (this was the missing piece).
Currency.MinValue and Currency.MaxValue - already canonical, unchanged.
The old Integer/Double spellings still exist, so existing code keeps compiling and running unchanged:
Integer.Min / Integer.Max - retained as deprecated compatibility aliases.
Double.Min / Double.Max - retained as deprecated compatibility aliases.
Using the short names now produces a normal deprecation warning that points you at the replacement, for example:
'Integer.Max' is deprecated: Use Integer.MaxValue instead.
'Double.Min' is deprecated: Use Double.MinValue instead.
The canonical names produce no warning.
A few deliberate decisions
Double.MinValue is the most negative finite Double and Double.MaxValue is the largest positive finite Double. Double.Infinity remains a separate value.
DateTime.MaxValue is the latest representable date/time (9999-12-31 23:59:59.999). DateTime.Empty is unchanged and is still the recommended way to represent an unset date.
- No
Currency.Min/Currency.Max or DateTime.Min/DateTime.Max were added - exactly one canonical pair per type.
Maths.Min()/Maths.Max() and Vector2.Min()/Vector2.Max() keep their names: those are methods that select or calculate a value, not boundary constants.
Duration gets no min/max bounds - Duration.Infinite already has its own no-timeout semantics.
- The new spellings also work everywhere the old ones did at compile time, including constant expressions such as
Duration.FromTicks(Integer.MaxValue \ 2).