Get the latest tech news
That boolean should probably be something else
Monday, June 30, 2025 One of the first types we learn about is the boolean. It's pretty natural to use, because boolean logic underpins much of modern computing.
But you can really start to have doubts here, and with any boolean, because the application logic meaning of the value cannot be inferred from the type. I've mainly run into one case where it makes sense: when you're (temporarily) storing the result of a conditional expression for evaluation. This is in some ways an optimization, either for the computer (reuse a variable) or for the programmer (make it more comprehensible by giving a name to a big conditional) by storing an intermediate value.
Or read this on Hacker News