A colleague told me I could use is and is not instead of the equality operators == and !=. I thought the is operator had something to do with types, and the official docs on MSDN agrees, but it also states:
Beginning with C# 7.0, you can also use the is operator to match an expression against a pattern
I didn't think checking values with is would work, but strangely it does:
> "tomato" is "apple"
false
> 1 is not 2
true
I assume it is the "expression pattern matching" at work here(?). My question is, since using is as the equality operator (==) seemingly works for values as well, is there any reason to avoid it? Would it be fine, performance and readability wise, to use is for all equality checks?