3 ms·
I'd kill for units of measure too. It makes maintaining any kind of engineering or scientific code so much easier.
by stult 2y ago
I'd kill for units of measure too. It makes maintaining any kind of engineering or scientific code so much easier.
- fuzzy2 2y agoIn a past project, we used Units.NET. It worked pretty well as far as I could tell. (I was not involved with the gritty domain details.) My colleagues even extended the library where units were missing.
- Jordanpomeroy 2y agoIn my experience units of measure in technical apps is only interesting in the UI layer as most apps I’ve worked on have a “base” system of units that all calcs are expecting. What alternate experience have you seen?
- greggyb 2y agoUnits of measure in F# are useful for more than unit conversion workloads. They are compile-time type information with no runtime overhead. So if you're using a lot of interrelated arrays, you can make a unit of measure for indices into just a specific type of array. This allows type-level enforcement of never using the wrong index for the wrong array. Anywhere you might want to keep categories (not category theory) of numeric values distinct from one another without intermixing, units of measure in F# can cover you.