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. C# futures: defer

C# futures: defer

Scheduled Pinned Locked Moved The Insider News
csharpswiftcomannouncement
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

    InfoQ[^]:

    Best known for its use in Go and Swift, C# proposal #1398 seeks to add defer statements. If you are not familiar with the concept, it can be summarized as a finally block appearing at the beginning of some code instead of the end.

    I could leave this feature for later

    M realJSOPR P 3 Replies Last reply
    0
    • K Kent Sharkey

      InfoQ[^]:

      Best known for its use in Go and Swift, C# proposal #1398 seeks to add defer statements. If you are not familiar with the concept, it can be summarized as a finally block appearing at the beginning of some code instead of the end.

      I could leave this feature for later

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

      It's not at the top of my list.

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

      1 Reply Last reply
      0
      • K Kent Sharkey

        InfoQ[^]:

        Best known for its use in Go and Swift, C# proposal #1398 seeks to add defer statements. If you are not familiar with the concept, it can be summarized as a finally block appearing at the beginning of some code instead of the end.

        I could leave this feature for later

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        Just because they implement a new feature doesn't mean you have to use it. I wish they'd quit putzing around with the language and make Visual Studio more reliable. Furthermore, Visual Studio could really use a freshening up of its icons..

        1 Reply Last reply
        0
        • K Kent Sharkey

          InfoQ[^]:

          Best known for its use in Go and Swift, C# proposal #1398 seeks to add defer statements. If you are not familiar with the concept, it can be summarized as a finally block appearing at the beginning of some code instead of the end.

          I could leave this feature for later

          P Offline
          P Offline
          PeejayAdams
          wrote on last edited by
          #4

          static void Main() {
          Console.WriteLine("Hello"); //1
          defer {
          Console.WriteLine("Foo"); //5
          }
          defer {
          Console.WriteLine("Bar"); //4
          }
          defer {
          Console.WriteLine("Baz"); //3
          }
          Console.WriteLine("World"); //2
          }

          Gives: Hello World Baz Bar Foo (Obviously) I can only say: Wow! Just wow! No, hang on, I meant: Why!? Just why!? We seem to have gone from spectacularly minor gains to complete insanity. Please stop fixing a language that wasn't previously broken!

          Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain

          M 1 Reply Last reply
          0
          • P PeejayAdams

            static void Main() {
            Console.WriteLine("Hello"); //1
            defer {
            Console.WriteLine("Foo"); //5
            }
            defer {
            Console.WriteLine("Bar"); //4
            }
            defer {
            Console.WriteLine("Baz"); //3
            }
            Console.WriteLine("World"); //2
            }

            Gives: Hello World Baz Bar Foo (Obviously) I can only say: Wow! Just wow! No, hang on, I meant: Why!? Just why!? We seem to have gone from spectacularly minor gains to complete insanity. Please stop fixing a language that wasn't previously broken!

            Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain

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

            Looks like a goto in a fancy dress.

            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