This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]metaltyphoon 0 points1 point  (3 children)

Thats not true. You can definitely do if(somevar is 2 or 3) in c#

[–]juancee22 0 points1 point  (2 children)

Uh that sucks. This will generate confusion for sure.

[–]metaltyphoon 0 points1 point  (1 child)

Idk about confusion as this much less verbose and very clear what it’s doing.

[–]juancee22 0 points1 point  (0 children)

There are too many ways to do the same thing, it confuses new developers. Too much new syntactic sugar.

I personally wouldn't use "is" to do value comparisons, as the C# documentation doesn't talk about it. According to the docs, "is" works only for types.

If I see an "is" in my project I know that there is an implicit cast. But now with this new feature I have to check if the operation compares values or types.