Y
Hacker News
new
|
ask
|
show
|
jobs
by
jy14898
334 days ago
example:
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
2 comments
eyelidlessness
333 days ago
To 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).
link
veidr
333 days ago
unless... you know
link