Uninitialized variables are 90% of our bugs, or so I've been told.
I don't consider a boolean "and" or "or" of a list of bools to be automatically true or false of an empty set, my friend. To me, the specific case for a boolean function applied to an empty list of bools would have to be explicitly stated in the design.
Thanks for explaining how mathematicians and logicians treat the empty set. I have more pragmatic situations to address :-)
Consider iterative code to sum a collection of ints:
For every non-empty collection this returns the correct result, and for the empty collection it returns 0.Now the product:
For every non-empty collection this returns the correct result, and for the empty collection it returns 1.Now the AND:
For every non-empty collection this returns the correct result, and for the empty collection it returns True.Now the OR:
For every non-empty collection this returns the correct result, and for the empty collection it returns False.Let's abstract it:
So now: This is why we define the results we do on empty collections. It's not just a convenience or a convention, it's consistent, and to do otherwise, even if documented, is to lay a trap for future maintainers.