DEV Community

Discussion on: Explain nodejs to me like Im five

 
jochemstoel profile image
Jochem Stoel

I would like you to elaborate on the problem of concurrency. What practical problem did this solve for you? What were you struggling with every day that Node solved by being single threaded? Do you even know why it is single threaded? I am very curious because the majority of web developers that are considered competent have zero understanding of this.

Thread Thread
 
nhsz profile image
Nicolás Quiroz

I mean, you don't have to deal with multiple threads like you do if you're working with other server-side languages.

Multi-threading is hard, like sharing data between threads. If you are working with server-side web programming in PHP, Java, Python, etc you will have to deal with it unless you have very low traffic APIs or services.

I think Go's approach to concurrency with "light threads" and goroutines is better than the async model though, but Node's was quite clever.

Thread Thread
 
jochemstoel profile image
Jochem Stoel

I think I have never reached any point where I needed to deal with multi-threading when I was writing something in for instance PHP. I suspect that I do this all the time.