ifn'tJPDev@programming.dev to Programmer Humor@programming.dev – 751 points – 10 months ago123Post a CommentPreviewYou are viewing a single commentView all commentsI'd take a not or "if not" operator tbh.It has a not keyword it's used for pattern matching. if (x is not null) It also has a !=.Pattern matching is different.Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha1 more...ifnt instead of ifn't1 more...
I'd take a not or "if not" operator tbh.It has a not keyword it's used for pattern matching. if (x is not null) It also has a !=.Pattern matching is different.Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha1 more...ifnt instead of ifn't1 more...
It has a not keyword it's used for pattern matching. if (x is not null) It also has a !=.Pattern matching is different.Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha1 more...
It also has a !=.Pattern matching is different.Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha
Pattern matching is different.Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha
Yeah, I just said it since you used it with null. I used it a lot for enumsThe type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha
The type matching is the most common thing I use it with. Combined with inline variables. if (x is string { Length: 5} s) { // do stuff with s } And switch expressions. As a side note inline variables are amazing haha
I'd take a
not
or "if not" operator tbh.It has a not keyword it's used for pattern matching.
It also has a
!=
.Pattern matching is different.
Yeah, I just said it since you used it with null. I used it a lot for enums
The type matching is the most common thing I use it with. Combined with inline variables.
And switch expressions.
As a side note inline variables are amazing haha
ifnt instead of ifn't