6
you are viewing a single comment's thread
view the rest of the comments
[-] starman@programming.dev 3 points 7 months ago* (last edited 7 months ago)

IMO, it would be more readable to just use ifs most of the times. But switch-case fallthrough is indeed, interesting behaviour

[-] notnotmike@programming.dev 3 points 7 months ago

Agreed, multiple if statements are much more readable, in my opinion. I generally think switch statements are always just a little too ugly unless their dead simple.

Switch expressions, on the other hand, are gorgeous code (as long as you don't use expression-bodied cases). I am always looking for chances to use switch expressions. So concise

[-] CCMan1701A@startrek.website 1 points 7 months ago

When the if/else is large I'm in the dictionary of functions boat.

[-] mihies@kbin.social 1 points 6 months ago

That doesn't sound very effective though.

[-] CCMan1701A@startrek.website 1 points 6 months ago

It works for older platforms that only run CF 3.5

[-] mihies@kbin.social 3 points 6 months ago

Is CF still a thing? But anyway, if it works, it works :)

this post was submitted on 16 Feb 2024
6 points (68.8% liked)

C Sharp

1518 readers
1 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS