Unlike the & and | logical operators which seem to have dubious use the
^ (XOR, exclusive or) logical operator can make things quite a bit easier.
For instance ever write a IComparable?
if (o1 == null && o2 != null)
if (o1 != null && o2 == null)
you can just do:
if(o1 == null ^ o2 == null)
like the other logical operators both sides of the conditional must be
evaluated but since we’re doing exclusive or-ing here it makes sense to
do it rather then in the cases of the other logical operators where fail
fast (or short-circuiting) conditional operators (like && and ||) would