Re:Please put units in names
by ReleaseCandidat on Monday March 21, 2022 @05:56AM
(#30752170)
I _really_, _really_ like F#'s 'unit of measure':
https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...
[ Parent
| on HN ]
Re:Please put units in names
by fluid_ident on Monday March 21, 2022 @09:49AM
(#30754087)
This. I really miss it when working outside of F#. I work on scientific code bases with a lot of different units and have been burned by improper conversions. Even with a high automated test coverage and good naming practices, such problems can go undetected.
It's a big omission that it doesn't support fractional units. These come up in things like fracture mechanics for stress intensity.
Re:Please put units in names
by ReleaseCandidat on Monday March 21, 2022 @10:25AM
(#30754494)
Are you talking about ksi√in or MPa√m? That is not a problem.