4 ms·
As much as I love branding, I would be hesitant to use it for critical math and where you might want to inspect the type at runtime as with money. Branding is
by spankalee 3y ago
As much as I love branding, I would be hesitant to use it for critical math and where you might want to inspect the type at runtime as with money.
Branding is easily circumvented, so it's best as a developer hint that helps document APIs and alerts us to common mistakes as an incremental improvement over primitives.
For money and similar I would use objects and a custom math library.
- epolanski 3y agoYou can parse before brand thus enhance and enforce runtime correctness.