35

As a human being, you're multithreaded. You can type with multiple fingers, you can drive and hold a conversation at the same time. The only blocking function we have to deal with is sneezing, where all current activity must be suspended for the duration of the sneeze. That's pretty annoying, especially when you're driving and trying to hold a conversation. You don't want to write code that's sneezy.

Comments
  • 4
    Edit:
    Not mine, taken from a Google dev article by Jake Archibald.
    Link: https://developers.google.com/web/...
  • 4
    You could perhaps argue that sneezing is garbage collection.
    You still don't want to much of that either, though
  • 1
    Actually, a JS process runs on one thread. It's not asynchronous, it's non blocking. I don't think there's a universal cure as most of the software you use everyday is not running on multiple threads and that's fine. :)
  • 0
    @runfrodorun yum
  • 1
    @kpenc ummm.... no offense but it's pretty clear that you are a primary node developer and don't understand what multi threading, async I/O, and blocking is
  • 0
    What a about seizure? That would be considered blocking right? Or probably sleeping as well, lol and jerking off or having an orgasm. I mean I guess you could probably jerk off while driving, but once that orgasm kicks in, you'd probably want to have someone else hold the wheel for a second ; )
  • 0
    @kpenc

    JS tends to be single threaded, but concurrent/async. Async, because it's fairly easy to create race conditions. Not truly parallel (unless you count workers/microservices), so you don't need channels, mutexes, etc like in Rust/Elixir/Go/Haskell/C#/etc
  • 1
    "you can drive and hold a conversation at the same time" Can i ask you step out of the vehicle please sir/madam?
Add Comment