starman,
@starman@programming.dev avatar

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

notnotmike,
@notnotmike@programming.dev avatar

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,

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

mihies,

That doesn't sound very effective though.

CCMan1701A,

It works for older platforms that only run CF 3.5

mihies,

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

Euphorazine,

Why post a stack exchange from 2008?

canpolat,
@canpolat@programming.dev avatar

Because it is about a not-very-well-known feature of the language. Why would it matter that it’s old? I don’t think I have ever seen this in use in production code.

Euphorazine,

An explanation like that at the start would have been helpful. I was reading the page and just didn’t understand. Was thinking at first it was to raise awareness of an unanswered question. Couldn’t figure it out so I asked.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • csharp@programming.dev
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines