Any pros/cons to using the "and" operator vs the && operator? I personally think "and" is only going to cause confusion (ironically).
If there aren't any differences, why does it exist? It seems silly and unnecessary.
Any pros/cons to using the "and" operator vs the && operator? I personally think "and" is only going to cause confusion (ironically).
If there aren't any differences, why does it exist? It seems silly and unnecessary.
It's the same operator. The difference is merely one of style. Consult your project documentation, or ask your boss, or your wife, or flip a coin.
They're anachronisms - they were originally introduced to accomodate folks who didn't have "^" or "|" characters on their keyboards.
Furthermore, although "and" and "&&" are equivalent ... "and" and "&" are quite different. Using "and" instead of "&&" is simply confusing on a number of different levels, for several different reasons. Including giving the poor maintenance programmer a completely unnecessary "wtf?" experience.
I would not use them in any code. And I've certainly never seen them used in any "live" code.
IMHO...
Here's a bit more on the topic, if you're interested: