Open vinitshahdeo opened 4 years ago
Hi @vinitshahdeo ,
Thanks for conducting this event, it helped a lot in knowing the internals of JavaScript as a programming language.
I wanted to know that why is it said that JS when executed on a machine i.e Node.js does not scale as much as compiled languages do like Golang, Rust or Java ?
Hello @theIYD π
Thanks for asking me this question.
Being single-threaded, Node.js has concurrency limitations but compiled languages like Go can scale up easily as they have better parallel execution mechanisms like Goroutines. But again, choice for tech-stack for your backend development between Node.js and Go totally depends upon how big your project is. In languages like Go, the parallel threads can be handled effectively.
Node.js is considered one of the best backend solutions for several reasons:
It inherits its asynchronous and non-blocking behaviour from JavaScript. This means that small tasks are performed in the background and donβt affect the main thread.
It uses the V8 engine which is considered as the fastest JavaScript engine.
Reusability: This is crucial for event-based applications that update data in real time, and itβs widely used for instant messaging, video chats, and online gaming.
Node.js is single-threaded, sometimes CPU-bound tasks block the event loop and slow down your program. As a result, you get a slower app, which might annoy your end-users but it totally depends how efficiently you write your Node.js application.
For larger applications, few points to keep in your mind while writing Node.js code:
Compile-time support: Find issues when you compile. It helps you to refactor your code.
Eliminate Callback Hell: Ensure that you're handling async behaviour in correct manner to avoid callback hell and increase performance.
Tooling: Choose best IDEs, unit-testing tools to speed up your development. npm
is β€οΈ!
Logging: Getting insights into your app is critical. Integrate with third party services easily.
Build on well vetted frameworks: The community is awesome. There're well-popular frameworks available which is being used by millions of developers across the world.
Last but not the least, choose Node.js to read 1000 files instead calculating 10th prime number.
PS: I have never worked at scale with GoLang. My whole tech stack is JavaScript and I've shared why one should prefer Node.js over others. Peace!
Thanks for the answer @vinitshahdeo βοΈ
I have been working with JavaScript from last 3 years, with Node.js as the backend framework. I have been making projects which do not scale but Node.js works best for them.
My question is to get hired as a backend engineer, should i be learning Golang/Rust or any compiled language ?
@theIYD Not really! Node.js is being used by various organizations like Postman, PayPal, Netflix, LinkedIn, etc. I believe that tech stack should not be a barrier during hiring process for <3 years of work experience.
@vinitshahdeo Okay, thank you sir for clearing my doubts! π
@theIYD you need not to learn new language to get hire. You need to learn how to scale with your current language. I have a suggestion here: https://twitter.com/ashokdey_/status/1281472402010943490?s=20
Also companies who hire you based on languages do not have anything to teach you for your holistic development.
@theIYD you need not to learn new language to get hire. You need to learn how to scale with your current language. I have a suggestion here: https://twitter.com/ashokdey_/status/1281472402010943490?s=20
Also companies who hire you based on languages do not have anything to teach you for your holistic development.
Extremely sorry guys seem like I forgot to log out of my sister's account. π
Hello, :wave:
Hope you're staying safe at home.
:mask: π :family:
Feel free to shoot your doubts in this thread.