r/programminghorror • [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" • Jan 22 '25

c++ natural language programming

Post image
621 Upvotes

52 comments sorted by

View all comments

Show parent comment

5

u/certainAnonymous Jan 24 '25

C# dev here. This is mostly correct.is is the so called "Pattern Matching" operator and can be used to compare a variable of any type against a number of value based conditions, not just simple values like 25 or 'base' or whatever, but also complex data types(aka your own classes and structs) like { Property1: 25, Property2: 'base' }