Is node really single threaded?!? What do people use it for? Interactive Prodigy games, or trawling AOL forums?
They use it to spend hours of their day hiding the fact that it’s single threaded by doing EVERYTHING asynchronously. It’s a great time sink.
$PHP = ;
31–40 of 43 posts
Re: $PHP = ;
#32Syntax error in a headline because HN can’t do emojis
I hope it is more a case of don't wish to do emojis.
parrot party, parrot party, parrot party
Re: $PHP = ;
#33After 15 years of PHP I went to .net last year. Their are many things PHP gets right and IMO are still better than ASP. For example, configuration is silly weird and complicated in ASP net core, php.ini still handles all the main settings just fine even after all these years.
Re: $PHP = ;
#34Re: $PHP = ;
#35Is node really single threaded?!? What do people use it for? Interactive Prodigy games, or trawling AOL forums?
Rather than blocking the thread on IO, you instead arrange for a callback to be executed once your IO operation is completed. The thread is then free to work on other tasks (e.g. other requests) while that operation is in progress. As a result, the thread is always busy.
The main disadvantages of this are that you are switching from straightforward top-down code to a continuation-passing style (mitigated somewhat by promises and async functions), and the fact that CPU-bound code will prevent other tasks from being serviced during execution.
There are similar facilities available in most languages now (including syntax sugar to help with things, such as C# through the async feature, and F# through the async computational expression), except that you also have the benefit of multiple threads.
Re: $PHP = ;
#36Re: $PHP = ;
#37Re: $PHP = ;
#38While being sarcastic and not really giving any meaningful technical information (which is fine!), this quick read made me remember that I definitely became more productive when I stopped seeing myself as a '[php/node/ruby/c/whatever] programmer' and started describing me as a 'problem solver using the best tools for a given context'.
And in spite of my opinions here, I will use languages and tools that I dislike, if that is what the customer needs as a means to solve their problem.
Re: $PHP = ;
#39Syntax error in a headline because HN can’t do emojis