▲ 764 ▼ ifn't (programming.dev) submitted 2 years ago by JPDev@programming.dev to c/programmer_humor@programming.dev 127 comments fedilink hide all child comments
[–] olafurp@lemmy.world 26 points 2 years ago (7 children) I'd take a not or "if not" operator tbh. permalink fedilink source hideshow 7 child comments replies: [–] Lmaydev@programming.dev 9 points 2 years ago* (5 children) It has a not keyword it's used for pattern matching. if (x is not null) permalink fedilink source parent hideshow 5 child comments replies: [–] olafurp@lemmy.world 3 points 2 years ago (3 children) It also has a !=. permalink fedilink source parent hideshow 3 child comments replies: [–] Lmaydev@programming.dev 2 points 2 years ago (2 children) Pattern matching is different. permalink fedilink source parent hideshow 2 child comments replies: [–] olafurp@lemmy.world 2 points 2 years ago (1 child) Yeah, I just said it since you used it with null. I used it a lot for enums permalink fedilink source parent hideshow 1 child comment replies: [–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent [–] Patches@sh.itjust.works 2 points 2 years ago Stuff can be two things permalink fedilink source parent [–] Appoxo@lemmy.dbzer0.com 3 points 2 years ago ifnt instead of ifn't permalink fedilink source parent
[–] Lmaydev@programming.dev 9 points 2 years ago* (5 children) It has a not keyword it's used for pattern matching. if (x is not null) permalink fedilink source parent hideshow 5 child comments replies: [–] olafurp@lemmy.world 3 points 2 years ago (3 children) It also has a !=. permalink fedilink source parent hideshow 3 child comments replies: [–] Lmaydev@programming.dev 2 points 2 years ago (2 children) Pattern matching is different. permalink fedilink source parent hideshow 2 child comments replies: [–] olafurp@lemmy.world 2 points 2 years ago (1 child) Yeah, I just said it since you used it with null. I used it a lot for enums permalink fedilink source parent hideshow 1 child comment replies: [–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent [–] Patches@sh.itjust.works 2 points 2 years ago Stuff can be two things permalink fedilink source parent
[–] olafurp@lemmy.world 3 points 2 years ago (3 children) It also has a !=. permalink fedilink source parent hideshow 3 child comments replies: [–] Lmaydev@programming.dev 2 points 2 years ago (2 children) Pattern matching is different. permalink fedilink source parent hideshow 2 child comments replies: [–] olafurp@lemmy.world 2 points 2 years ago (1 child) Yeah, I just said it since you used it with null. I used it a lot for enums permalink fedilink source parent hideshow 1 child comment replies: [–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent
[–] Lmaydev@programming.dev 2 points 2 years ago (2 children) Pattern matching is different. permalink fedilink source parent hideshow 2 child comments replies: [–] olafurp@lemmy.world 2 points 2 years ago (1 child) Yeah, I just said it since you used it with null. I used it a lot for enums permalink fedilink source parent hideshow 1 child comment replies: [–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent
[–] olafurp@lemmy.world 2 points 2 years ago (1 child) Yeah, I just said it since you used it with null. I used it a lot for enums permalink fedilink source parent hideshow 1 child comment replies: [–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent
[–] Lmaydev@programming.dev 1 point 2 years ago* 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 permalink fedilink source parent
[–] Patches@sh.itjust.works 2 points 2 years ago Stuff can be two things permalink fedilink source parent
[–] Appoxo@lemmy.dbzer0.com 3 points 2 years ago ifnt instead of ifn't permalink fedilink source parent