&& || and or
So it turns out you learn stuff when you read and I’ve noticed that you remember stuff when you write it down, so since this is the best tech blog ever I’m writing it down here so you all can look at it and learn it (it’s gonna be up to you to write it down somewhere else if you wanna remember it). I’m not sure about JSTL or other languages but I’d wager they are the same. if you were wondering which is better to use && vs. “and” or || vs. “or” in your expressions it pretty much all depends because they have different precedences (is that a word? huh spell check likes it.). First of all && has a higher precedence than || (at least in php) and “and” has a higher precedence than “or” but || has a higher precedence than “and”, thus || and && both have higher precedences than “or” and && also has a higher precedence than “and”. Confused? k here is the breakdown, higher precedence listed first:
&& || and xor //I know we didn't cover this but it's in there... trust me. or |
as a side note “xor” means one or the other is true but not both… I can see how that could be handy.