Even though I'm a backend developer, my main programming language is JavaScript, and the reason is simple:
JavaScript, like English, has many inconsistencies, historical quirks, and flaws, but it is EVERYWHERE.
Atwood's law: "Any application that can be written in JavaScript, will eventually be written in JavaScript".
There is a JavaScript runtime environment on almost every phone and computer—your browser.
You can’t run away from it - One of my friends hates English and uses it only because he needs it for his PhD. Same with JS. It’s everywhere.
Personal Opinion: I didn’t struggle much because of my choice of main programming language. Other issues are more challenging.
*Why Use JavaScript on the Backend? *
- Unified Language Stack (Full-Stack Development) - You don’t need another programming language. No Context Switching.
- An asynchronous, single thread, Non-Blocking I/O Model
- Asynchronous means that tasks can run independently of the main program flow
- A single-threaded system means the program can only execute one task at a time
- Input/Output: Great for I/O tasks like Network requests, Data queries, API calls
- Asynchronous means that tasks can run independently of the main program flow
- Scale applications horizontally AKA Use multiple servers
- Fast Execution Speed
When to avoid it:
- Scale applications vertically AKA CPU-intensive processes.
Tip: Match your language choice to your goals
Don’t use Javascript to develop an AAA video game
- Technically, you could achieve this using worker threads or child processes, but this is not Node's default or ideal use case.
Next topic: Monolits vs Microservices. Stay Tuned!
Top comments (8)
I like the concept of comparing a computer language to a spoken language, and I agree Javascript is the English of programming languages.
I would suggest that COBOL is the Latin of programming languages. Latin, a dead language that no one has ever heard spoken, yet some people still insist on using it.
Completely Agree!
As a f/e React developer, I hope it would be relevant to add this as a side (not for or against) argument:
I love React, and I think React is great, exactly because it enables me to:
-- use a "minimal" subset of Javascript,
-- avoid a big portion of the Javascript language/environment,
-- and escape the ugly half of Javascript (eg. scoping, closures, globals, lack of types.)
I love the good half of the post-ES5 Javascript encapsulated inside small React functions, with the help of minimal amount of Typescript parameter typing.
Imho :)
javascript is everywhere.
True, but should it?
Well, it depends on how you look at it. JavaScript's presence everywhere is a testament to its flexibility and the vast ecosystem around it. It's hard to deny its convenience for building full-stack applications with a unified language.
That said, there are cases where using JavaScript might not be the most efficient choice—like in high-performance computing or systems programming, where other languages excel. So, maybe it’s not about whether it should be everywhere but rather about using it where it truly shines. Or what do you think?
I think the demand for developers has resulted in too low a barrier to entry. Resulting in an industry heavily populated with developers who only know JS, and often not even JS but a single JS framework. This leads to the problem that "if your only tool is a hammer, everything looks like a nail". I have heard that some said everything will be written in JS someday but I fear many developers fail to understand why that would be a very bad thing. Do you really want your fully autonomous car travelling at 120kph, controlled by JS, just because, a) we could or, b) that was all the developers our VC funding would cover? I think not.
If you think I am driving and extreme care that would not happen, check out the Therac-25 incident and tell me it would not happen today or in the near future.
Disappointed to have followed a link to this 'article'. I expected to learn something.