6 ms·
Why is nominal typing desirable?
by goodoldneon 1y ago
Why is nominal typing desirable?
- jy14898 1y agoexample: type FireNuke = boolean; type DontFireNuke = boolean; function perhapsFireNuke(action: FireNuke); you wouldn't want to call perhapsFireNuke with DontFireNuke, even though the types are compatible
- veidr 1y agounless... you know
- eyelidlessness 1y agoTo be fair, this is a better example of booleans being a poor fit for modeling many problems. And it’s solvable without even addressing either issue (eg how this is modeled in the real world with multiple affirmatives).