News for hackers. Stuff that matters.
Re:Please put units in names by int_19h on Monday March 21, 2022 @04:57AM (#30751823)
All you need is a language that actually incorporates units of measure into the type system - i.e. you can define units orthogonal to types (including relationships between units), and then you can specify both the unit and the underlying numeric type in a declaration.

https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...

This can also be pulled off with somewhat less pleasant syntax on top of a sufficiently flexible parametrized type system - e.g. C++ templates.

There are no comments on this comment yet.