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. The Lounge
  3. Do we really need asynchronous programming? I don't think so.

Do we really need asynchronous programming? I don't think so.

Scheduled Pinned Locked Moved The Lounge
csharpcomdesignquestion
28 Posts 14 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.
  • D Offline
    D Offline
    Dominic Burford
    wrote on last edited by
    #1

    Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

    "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

    R D L A V 12 Replies Last reply
    0
    • D Dominic Burford

      Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

      "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      I am totally in sync with him.

      Do not escape reality : improve reality !

      1 Reply Last reply
      0
      • D Dominic Burford

        Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

        "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

        D Offline
        D Offline
        den2k88
        wrote on last edited by
        #3

        I can't read the article (the Thought Police doesn't allow me to see the Internet, only some sites) but I agree with the piece you reported. Asynchronous code is necessary but it is tricky and requires a good understanding of the synchronous code. Otherwise you simply make mistakes on multiple threads contemporarily :D

        Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

        L 1 Reply Last reply
        0
        • D Dominic Burford

          Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

          "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I don't know what we may need or not need, but I'm going to take another shot at writing my own UI. This time I'm going to use something that Mickeysoft can't pull away from under my feet, like OpenGL. Anyway, it's not going to get very far without letting I/O, message queues, rendering, data access and the actual applications run in separate threads.

          The language is JavaScript. that of Mordor, which I will not utter here
          This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
          "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

          L 1 Reply Last reply
          0
          • D den2k88

            I can't read the article (the Thought Police doesn't allow me to see the Internet, only some sites) but I agree with the piece you reported. Asynchronous code is necessary but it is tricky and requires a good understanding of the synchronous code. Otherwise you simply make mistakes on multiple threads contemporarily :D

            Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            den2k88 wrote:

            but it is tricky

            About as tricky as cooking dinner, as long as you don't create a total mess. As long as you have well defined areas where threads may overlap, keep those areas as small as possible, access those areas as sparingly as possible and use proper synchronization for every access, you are totally safe.

            The language is JavaScript. that of Mordor, which I will not utter here
            This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
            "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

            D 1 Reply Last reply
            0
            • L Lost User

              I don't know what we may need or not need, but I'm going to take another shot at writing my own UI. This time I'm going to use something that Mickeysoft can't pull away from under my feet, like OpenGL. Anyway, it's not going to get very far without letting I/O, message queues, rendering, data access and the actual applications run in separate threads.

              The language is JavaScript. that of Mordor, which I will not utter here
              This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
              "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              CDP1802 wrote:

              but I'm going to take another shot at writing my own UI

              Did your first shot result in something one could take a look at?

              Recursion: see Recursion.

              L 2 Replies Last reply
              0
              • L Lost User

                den2k88 wrote:

                but it is tricky

                About as tricky as cooking dinner, as long as you don't create a total mess. As long as you have well defined areas where threads may overlap, keep those areas as small as possible, access those areas as sparingly as possible and use proper synchronization for every access, you are totally safe.

                The language is JavaScript. that of Mordor, which I will not utter here
                This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                D Offline
                D Offline
                den2k88
                wrote on last edited by
                #7

                CDP1802 wrote:

                About as tricky as cooking dinner

                Quite tricky indeed, if you're not satisfied to just not poison yourself :) To cook an averagely tasting, looking and smelling dinner one should have a healthy dose of experience, think just how it is easy to burn onions or undercook eggs the first times, or to make overcooked pasta for example. The menaing is just that: before starting to think to exotic dishes make some experience in cooking a simple carbonara (which ain't so simple for beginners by the way).

                Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

                L 1 Reply Last reply
                0
                • L Lost User

                  CDP1802 wrote:

                  but I'm going to take another shot at writing my own UI

                  Did your first shot result in something one could take a look at?

                  Recursion: see Recursion.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Yes, I once posted some small video clips. I will try to find them.

                  The language is JavaScript. that of Mordor, which I will not utter here
                  This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                  "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                  1 Reply Last reply
                  0
                  • L Lost User

                    CDP1802 wrote:

                    but I'm going to take another shot at writing my own UI

                    Did your first shot result in something one could take a look at?

                    Recursion: see Recursion.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    I found one video, but it shows more of the graphics. The only UI object visible is the small menu in the upper left corner and it's not used here. I think there was another one, but I will have to look. For now, it's more graphics and animation: Video #1[^] Edit: Here is another one. The resolution was reduced to a low value so that the text at least remained readable: Video #2[^]

                    The language is JavaScript. that of Mordor, which I will not utter here
                    This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                    "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                    L 1 Reply Last reply
                    0
                    • D den2k88

                      CDP1802 wrote:

                      About as tricky as cooking dinner

                      Quite tricky indeed, if you're not satisfied to just not poison yourself :) To cook an averagely tasting, looking and smelling dinner one should have a healthy dose of experience, think just how it is easy to burn onions or undercook eggs the first times, or to make overcooked pasta for example. The menaing is just that: before starting to think to exotic dishes make some experience in cooking a simple carbonara (which ain't so simple for beginners by the way).

                      Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      And then again, most people do it every day successfully.

                      The language is JavaScript. that of Mordor, which I will not utter here
                      This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                      "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                      D X 2 Replies Last reply
                      0
                      • L Lost User

                        And then again, most people do it every day successfully.

                        The language is JavaScript. that of Mordor, which I will not utter here
                        This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                        "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                        D Offline
                        D Offline
                        den2k88
                        wrote on last edited by
                        #11

                        Successfully as in "not poison", which is the equivalent of "it just works". And we're talking of grown-ups (=people with experience). If you take a person who never cooked or cooked very little you probably end up with a very bad dish (= software of poor quality). That's the main point of what I'm saying: learn how to walk before attempting to run.

                        Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

                        L 1 Reply Last reply
                        0
                        • D den2k88

                          Successfully as in "not poison", which is the equivalent of "it just works". And we're talking of grown-ups (=people with experience). If you take a person who never cooked or cooked very little you probably end up with a very bad dish (= software of poor quality). That's the main point of what I'm saying: learn how to walk before attempting to run.

                          Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X // No comment

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          Sure. I just can't hear anymore what kind of new languages and tools we need to solve this or that problem. So my version is: Learn how to walk before running off to the next new thing, only to discover that it still can't replace experience and some effort.

                          The language is JavaScript. that of Mordor, which I will not utter here
                          This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                          "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                          1 Reply Last reply
                          0
                          • L Lost User

                            I found one video, but it shows more of the graphics. The only UI object visible is the small menu in the upper left corner and it's not used here. I think there was another one, but I will have to look. For now, it's more graphics and animation: Video #1[^] Edit: Here is another one. The resolution was reduced to a low value so that the text at least remained readable: Video #2[^]

                            The language is JavaScript. that of Mordor, which I will not utter here
                            This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                            "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            Ah! I always wanted to make a spaceship-game. Looks good! Thanks for digging it up :)

                            Recursion: see Recursion.

                            L 1 Reply Last reply
                            0
                            • L Lost User

                              Ah! I always wanted to make a spaceship-game. Looks good! Thanks for digging it up :)

                              Recursion: see Recursion.

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              It actually was more of a browser game, just without the browser. Instead of sleepy web pages we had the 3D engine showing stuff of interest in the background and the UI in the foreground for the gameplay. It may also show what nice web applications can be done if you just forget about browsers and everything connected with them.

                              The language is JavaScript. that of Mordor, which I will not utter here
                              This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                              "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                              1 Reply Last reply
                              0
                              • D Dominic Burford

                                Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                A Offline
                                A Offline
                                Afzaal Ahmad Zeeshan
                                wrote on last edited by
                                #15

                                I would say, don't use guns unless you're an army guy or a security provider! Similarly, don't use async programming model unless you know what you're doing. async programming can be made easy if you're able to understand, why WPF applications seem like to hang up when you're working with a (web of disk) resource, user would believe that the application has just hung up whereas it is waiting for the thread to be freed to update the GUI. Synchronous programming is easy, I know... Just write the code and the machine would execute line-by-line. No problem right? But that is a good thing while programming a Console application. Client knows, he has to wait for the command to execute. But, if you're providing a graphical interface, you've already given the developers a pain in (well you know)... Thus using async model won't be painful enough for them. They will be able to handle. Finally, everyone has their own point of view. I have never used async model in Console application, waiting doesn't cause a problem... That cursor keeps me notified that something is going on (unless I am asking for a value to be fetched; with a label above). But if I am going to develop a WPF application, I should be using async model for responsiveness of the graphical interface. The one thing I like about the answer is the ASP.NET MVC solution, he is right! Browser would always wait for the time until the response has been made and sent back. Using async model there would be an idiotic action.

                                The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

                                M D 2 Replies Last reply
                                0
                                • D Dominic Burford

                                  Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                  "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                  V Offline
                                  V Offline
                                  Vark111
                                  wrote on last edited by
                                  #16

                                  While I agree with the overall tone of his post (async/await in .NET is the new hammer making everything look like new nails), I disagree with the assertion that async coding is "new" or even "hard". The vast majority of .net programmers have been doing async coding since back in the days of .NET 1.0. Anyone who has handled events in .NET has probably done async coding. They may not have known it, and they may have done things wrong, which blew up in seemingly weird ways (and were written off as "cannot reproduce" tickets). But it's async coding. Async coding in .NET is hard, yes. But async in general can be a breeze if you have the right framework for it. Example: async coding in Node is dead simple.

                                  1 Reply Last reply
                                  0
                                  • D Dominic Burford

                                    Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                    "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                    B Offline
                                    B Offline
                                    Brady Kelly
                                    wrote on last edited by
                                    #17

                                    I have a GUI that allows the user to trigger processing that involves several web service requests, on two independent web services, and several email messages to subscribers. There is very little I can do to optimize the length of this processing anywhere close to the 100ms limit[^], so when the user clicks the "Force Processing" button, I await that processing and give the user back their UI. I think this is a bloody good reason for using asyn.

                                    No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde

                                    1 Reply Last reply
                                    0
                                    • D Dominic Burford

                                      Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                      "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                      T Offline
                                      T Offline
                                      thund3rstruck
                                      wrote on last edited by
                                      #18

                                      I can't read the article either but good luck developing a desktop application that doesn't hard lock and go into a 'not responding' state every time someone triggers an event handler without implementing asynchronous multi threading.

                                      1 Reply Last reply
                                      0
                                      • D Dominic Burford

                                        Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                        "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                        S Offline
                                        S Offline
                                        stevev6
                                        wrote on last edited by
                                        #19

                                        Asynchronous programming is not needed if you have an advanced OS that can extract the parallelism from your executable and distribute that processing across all of its cores. Otherwise, you need to learn how to do it. It will probably serve you better than trying to learn the newest sexy programming language that hides the multitasking with a "trust us, we know what you want to do". It's really cool too.

                                        1 Reply Last reply
                                        0
                                        • D Dominic Burford

                                          Came across this reply from the .NET Junkie[^ and he puts forward a compelling argument for why we should focus on writing better synchronous code before we try to write asynchronous code.

                                          "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #20

                                          If you ever get for a sec outside of website programming and try some multi-threading, there is no way you can do anything without asynchronous calls.

                                          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