Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Moving from the switch statement to switch expressions

Moving from the switch statement to switch expressions

Scheduled Pinned Locked Moved The Insider News
csharplinqcomregexfunctional
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Christian Nagel[^]:

    Switch expressions and enhanced pattern matching are great new concepts working together with C# 8.

    For those switching switches

    "Compared to the switch statement the essentials of the code are easier to grasp..." uh... "...as soon as you are used to Lambda expressions." Well, that explains it then.

    M D 2 Replies Last reply
    0
    • K Kent Sharkey

      Christian Nagel[^]:

      Switch expressions and enhanced pattern matching are great new concepts working together with C# 8.

      For those switching switches

      "Compared to the switch statement the essentials of the code are easier to grasp..." uh... "...as soon as you are used to Lambda expressions." Well, that explains it then.

      M Offline
      M Offline
      MarkTJohnson
      wrote on last edited by
      #2

      And

      Quote:

      With the code sample I’ve also used the C# 8 feature nullable reference types.

      to make it even more different than the older code.

      M 1 Reply Last reply
      0
      • M MarkTJohnson

        And

        Quote:

        With the code sample I’ve also used the C# 8 feature nullable reference types.

        to make it even more different than the older code.

        M Offline
        M Offline
        Mark_Wallace
        wrote on last edited by
        #3

        Change for change's sake.

        I wanna be a eunuchs developer! Pass me a bread knife!

        R 1 Reply Last reply
        0
        • M Mark_Wallace

          Change for change's sake.

          I wanna be a eunuchs developer! Pass me a bread knife!

          R Offline
          R Offline
          Rick York
          wrote on last edited by
          #4

          That's my impression of the entire language.

          "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

          1 Reply Last reply
          0
          • K Kent Sharkey

            Christian Nagel[^]:

            Switch expressions and enhanced pattern matching are great new concepts working together with C# 8.

            For those switching switches

            "Compared to the switch statement the essentials of the code are easier to grasp..." uh... "...as soon as you are used to Lambda expressions." Well, that explains it then.

            D Offline
            D Offline
            Daniel Pfeffer
            wrote on last edited by
            #5

            Switch expressions bring to mind the "computed GOTO" and "arithmetic IF" in Fortran II. Anyone else here remember them?

            Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups