Pattern matching ranges in C# are awesome

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

0 < x && x < 100 is my favorite way.
I'd love 0 < x < 100 if it was possible.

gladkiypasha
Автор

Why do we need a different syntax for boolean operations in pattern matching and that alone? This is just confusing.

EdKolis
Автор

Lol, why are there only bot comments here? Btw, great video! Works only with const values, btw

cn-ml
Автор

Why is your IDE (Rider, by looks of it) underlining them as warnings?

KvapuJanjalia
Автор

Thanks for listening
On your last short about pattern matching I asked for more

JacobGlanz
Автор

You should probably suppress the warnings from the top of the file

anar.bastanov
Автор

Unfortunately, this only works with constant values. You cannot even use this with System.Decimal

izobrr
Автор

Only 4 more to celebrate guys, get ready!

hasmich
Автор

For range checks, wouldn't be better if we could use 0..100, may be surrounded by square brackets?

gpapadopoulos
Автор

What is the real advantage of using this syntax? I'd imagine they haven't introduced it just for funsies, so what is this syntax doing that the "plain" syntax can't?

inzyster
Автор

import reminder that writing "not < 10 or > 90" the "not" only applies to the first one. So it becomes (x >= 10 || x > 90) which then simplifies to just (x >= 10).
tl;dr:
x is not < 10 or > 90
is not the same as
x is not (< 10 or > 90)

JackTheSpades
Автор

This is just stupid and ugly, they could have just replaced the && with 'and', It would have looked like Python. That 'is' is just so extra. If we continue at this pace, in 10 years C# would be a complete shitshow.

MinimalistDev
Автор

Seeing function and property names starting with a capital letter, hurts the eyes.

FeLiNe
Автор

Why does pattern matching only work with constant values? Like wtf were they thinking?

RealCheesyBread
Автор

I have been watching your content for a long time. I'm just messing with you. My neighbors don't care about pattern matching operations lol.
I wish they would have considered how awkward `x is { } name` looks. I wouldn't care if it didn't recommend I do that instead of a simple null check

dadsoul
Автор

it looks so odd that your IDE thinks it's a
mistake...

why not just 1 < x < 3?

しめい-lm
Автор

This syntax is cumbersome to read, dont you think?

HhddGufif
Автор

While it's an improvement over <cumbersomeVariable name> < 1 && <cumbersomeVariableName> > -1 I'd still prefer just writing -1 < <cumbersomeVariableName> < 1.

ignispurgatorius
Автор

I hate c# even more because it’s hard to read, I don’t want a complex OO language with endless non intuitive features and syntax sugar. Just a solid language with solid libraries and primitives please

corykeilig
Автор

And this is how a feature becomes a PR review nightmare. This makes C# a visual Basic twin. Features like this where you write the same thing in 150 different ways make a language die quickly, especially for basic stuff like this. && and || are the brain default values for any normal non sucking dev. Mathematical expression of terms should be the norm, we should not let math illiterate people touch code if they don't understand it.

Albivl
visit shbcf.ru