Hacker News new | ask | show | jobs
by theonething 1025 days ago
> If something really is just a map or a boolean or an integer then you can't avoid this kind of thing. But usually it isn't,

No matter how much you abstract out and dress up a boolean, at its heart it's still a boolean value and I don't see how making a custom type based on boolean would prevent returning the inverse of a boolean value bug.

1 comments

Most of the time a "boolean" isn't a boolean - it's a flag to indicate one of two different things, which is something you can represent more directly.