The boolean tag has no wiki summary.
2
votes
2answers
98 views
The rationale behind Falsy values
I'm wondering what the arguments for/against Falsy values are. On what principles would you decide to add or exclude them from a language? Are there any problems you could see them causing off-hand?
...
4
votes
4answers
216 views
Returning a boolean when success or failure is the sole concern
I often find myself returning a boolean from a method, that's used in multiple locations, in order to contain all the logic around that method in a single place. All the (internal) calling method ...
4
votes
1answer
259 views
boolean or Boolean?
I was doing edit reviews on Stack Overflow and found out that people keeps correcting the word "boolean", replacing it with "Boolean" when it appears in text (but not in source code, of course). And ...
16
votes
2answers
739 views
Why is Java boolean primitive type name not 'bool'?
Java has
int and Integer
boolean and Boolean
This seems a bit inconsistent, why not either
bool vs Boolean to use an established shorter name for primitive type?
or
integer vs Integer to ...
28
votes
2answers
1k views
Why is a Boolean value stored as a byte inside of a computer when it only requires one bit
I recently started learning to write code, and in my book I came across this question. "Why is a Boolean value stored as a byte inside of a computer when it only requires one bit?" can someone shed ...
27
votes
4answers
4k views
When should you use bools in C++?
We had an assignment for our class where we had to create a Tic-tac-toe game. People like to complicate themselves, so they wrote complex games which included menus. At the end of the game, you had to ...
2
votes
3answers
275 views
Computers that operate exclusively on boolean algebra
I was wondering if there are any computers that operate exclusively on boolean operations. For example, no add, sub, mult, or div in the instruction set (although these could be emulated with the ...
36
votes
17answers
3k views
Why Use !boolean_variable Over boolean_variable == false
A comment on this question: Calling A Method that returns a boolean value inside a conditional statement says that you should use !boolean instead of boolean == false when testing conditions. Why? To ...
6
votes
5answers
955 views
Why is there both a short-circuit OR as well as unshort-circuited variation of that operator in C#?
Periodically, I wonder about this:
The short-circuit OR would always return the same value that the unshort-circuited OR operator would?
I expect that the short-circuit OR would always evaluate ...