3 ms·
I like the way it's asynchronous first and everything revolves around the event loop. It makes responsive GUI's very easy to create. Always thinking asynchrono
by gitgud 5y ago
I like the way it's asynchronous first and everything revolves around the event loop. It makes responsive GUI's very easy to create.
Always thinking asynchronously means your less likely to create synchronous render-blocking code which sucks for users.
Also the npm ecosystem and tooling is very easy to work with and easy to understand (everything is under node_modules not some globally installed binary)
It's great for small projects and websites, but anything that requires performance would probably be better in a compiled language.
- mekster 5y ago> I like the way it's asynchronous first This has been such a mistake, now it needs "await" all over the code. Programs run synchronously and only needs to go async every once in a while but things get pretty verbose from it.
- gitgud 5y ago> This has been such a mistake, now it needs "await" all over the code. Await is just a syntactic sugar, and quite a good one I think. You need to seperate async and sync functions somehow in order to prevent code from blocking the main thread. > Programs run synchronously and only needs to go async every once in a while but things get pretty verbose from it. Well I would argue that most things a program does (besides crunching raw data within memory) is asynchronous. Network requests, painting to screen, polling IO ports, fetching from the Filesystem, handling user interaction... these are all examples of asynchronous operations. It's simpler to have a single-threaded event-loop rather than spinning up threads and keep track of them, preventing deadlocking etc... A single-threaded event-loop also has the benefit of being incapable of dead-locking, as only one thread is accessing variables at any given point.