I see. Because you believe things that plainly are not true... That's
not a very good reason.
Well Göran Andersson, since you are such the expert programmer, I will
give you a quick quiz, taken from an excellent book by Scott Meyers,
written over 10 years ago (Scott was the Jon Skeet of the 1990s--he's
coming out with a new book, but I was surprised he only wrote three
books, all three of which I own; btw Meyers does not believe in on-the-
spot language quizzes given to job applicants, since they are too
stressful and don't prove much; better to rely on source code the
candidate has written, but I digress):
Quiz Question: (from Item #7 of "More Effective C++")
in the statement from this code: "char *p; /*...*/ if ((p!=0) &&
(strlen(p) > 10)) ... "
does the second expression, strlen(p) > 10, get executed?
Answer:
~
~
~
~
~
since char *p is a null pointer, then only the first expression is
executed and the second expression is never even considered, since it
is irrelevant in Boolean Algebra. In fact, if the second expression
was considered, you would crash your program since strlen cannot take
a null pointer.
Now, how does that affect your Boolean Algebra? Shows that x&&y is !=
y&&x, at least in "if" expressions of this kind! Try reversing these
expressions, so that it's written: if ((strlen(p) > 10) && (p!=0))
and watch your program crash. Meyers goes on to say that in fact
programmers often specifically write statements in the above specific
order, so that only the first expression is executed, knowing this
rule, and thus if the language were to be redefined so that both
expressions were automatically considered always, it would break a lot
of existing code.
Put that in your Boolean pipe and smoke it!
RL