DEV Community

Rachel Snijders
Rachel Snijders

Posted on

Why is everything Javascript?

I am not sure if this is the right place and time to ask this question, but there is something I really don't understand. You might have guessed what.

Nowadays, there are seemingly more programming languages, frameworks and ways of solving software related problems than values in a 64 bit integer. Additionally, I really don't like working with or reading (about) Javascript. It feels messy, there are a million ways to do anything, yet everything 'feels' wrong.

So why does it seem like everyone is obsessed with the language? Every community, video platform, in-person meetup always has like a 65% focus on Javascript and 35% anything else.

Am I missing some universal truth that will make me love the language? Most other tools I find really interesting and I want to learn more about them, like Go, Rust, various data storage systems, etc.

But out of all things, Javascript seems to rule the world.

Top comments (36)

Collapse
 
lexlohr profile image
Alex Lohr

ECMAscript (also known as JS) is the standard scripting language running inside web browsers. Attempts to change that (VBscript, Java applets, Flash/ActionScript, GWT, Dart) have all failed.

Furthermore, JS succeeded beyond the browser, making its jump to the server (node, deno, bun, llrt) and embedded systems (espruino).

There's no hidden truth that will magically make you love JS. Like any other language, you'll have to get used to it to get comfortable using it. Starting with ES6 which was released 2015, it got a lot better over the years and is still improving. The same applies to the tools around the language.

If every solution feels wrong for, maybe what you need is a mentor to guide you. Or maybe you're just not meant to be a JS Developer and should rely on web assembly to run languages like rust in the browser.

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

For me, I use JavaScript because it's the closest thing to Write Once, Run Anywhere with no compilation step.

  • JIT compilation, no build scripts to make things work if you go vanilla.
  • A homogenous language between the front end and back end reduces context switching and improves my performance.
  • In recent years it's become a pretty nice language to express yourself in, especially for async code, and its dynamic nature is part of its power, not its pitfall - but it needs embracing, not hiding from.
  • Massive community support, huge numbers of open-source packages
  • It's fast enough for every app I've built and you can easily integrate other things if you need to

I say this as someone who comes from a C, C++, and Java background with a decade-long sojourn into C#

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

JavaScript used to be very messy and quirky before esllint, JSDoc, ECMAScript, and TypeScript. But it is still far from clean and type-safe. But it used to be the only programming language supported by every web browser, and with Rhino, node, and Webpack, people started using JavaScript for backend and dev-ops, so that they did not have to learn additional languages like Python, Perl, or bash:

Collapse
 
bwca profile image
Volodymyr Yepishev

'cos you can build anything with it 🫣

Image description

Collapse
 
tandrieu profile image
Thibaut Andrieu

In the early 2ks, there were essentially C/C++ and Java. And VB, but we don't talk about VB. These languages were hard to use, and had the unfortunate tendency to crash your whole machine at the slightest mistake. So you needed a lot of courage and pugnacity to write a single working program. This era gave birth to great, high-quality softwares like... Windows Millennium or... Internet Explorer 6.

Then, Web comes into play with its javascript.

Suddenly, every dumb-a** teenager with a keyboard were able to integrate fireworks, animated banner or that kitten that follow your mouse in their web page. javascript, contrary to other langage, was very permissive, and let you create funny annoying stuff very easily, as long as you don't watch the error console. It spread all around the web like a cancer. Years latter, those teenager becames Engineer, then Directors. And they bring with them what they have learned, forcing everyone to use this technology for things it wasn't created for.

Their madness pushed them to create javascript for desktop with electron, or even worst, Node.js, to port javascript where it should never have been: on the backend...

That, Rachel, is the story of the worst creation of mankind...

Collapse
 
peerreynders profile image
peerreynders

Am I missing some universal truth that will make me love the language?

The universal truth is that there is no need to love JavaScript (or TypeScript).

You will never master JavaScript if you cannot learn to respect its idiosyncrasies.

To get into the right frame of mind perhaps watch this:

“Dear Developer, the Web Isn't About You”

… and paraphrasing …

“Dear Developer, JavaScript Isn't About You”—but what you can accomplish with it (in a relatively short amount of time).

The way to get on with JavaScript is to know and respect its faults, recognize its strengths and above all, to not try to make it into something it isn't by shoehorning it into a frame of some programming language you happen to be familiar with or one you would rather be working with—JavaScript is what it is.

Once you get to that level of competency, JavaScript is a non-issue and you can move on to enjoying building whatever you need to build (and whatever value that provides). JavaScript, just like programming, is a means to an end—not an end in itself.

That said, experience in other (Scheme or Lisp flavoured) programming languages will benefit JavaScript competence.


More recently, “why” it's happening:

“… because of the hydration problem … for these declarative Frameworks to work on both sides efficiently, you need to have JavaScript on both sides; I'm not saying your whole back end has to be JavaScript …”

Evolving Isomorphic Data-Fetching - YouTube

New constraints have been leading to a complete rethinking of how we handle isomorphic data-fetching in JavaScript frameworks. Truthfully I don't have the fu...

favicon youtube.com

“… if you're not using JavaScript on the server, you're doing it wrong … but if you care about end-user experience, you can make more significant improvements by running JavaScript on the server [compared to any other server language «you» prefer] …”

Evolving Isomorphic Data-Fetching - YouTube

New constraints have been leading to a complete rethinking of how we handle isomorphic data-fetching in JavaScript frameworks. Truthfully I don't have the fu...

favicon youtube.com
Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

My take, just keep doing what your doing your job security is far greater in rust or go or any lower level.

The idea of a scripting language as a backend is appealing I suppose for ecosystem and speed and you know what they say, go where the money is.

Personally I’m learning C# and python lately

Collapse
 
mrlinxed profile image
Mr. Linxed

A lot of the things are done with the web browser nowadays. And Javascript happens to be what runs in browsers.

If you're already hiring javascript developers you might as well make your backend in JS as well.

Aside from that, if something is popular enough, it'll fuel itself. It's hip. It's easily talked about. It creates lots of views and interaction. Other languages are viewed as dusty.


That being said, you do what you want to do. You shouldn't be writing code in a language you don't like, you'll burn out. There are still plenty of jobs out there using other languages. And no, I don't think you'd be shooting yourself in the foot with it.

Collapse
 
alvaromontoro profile image
Alvaro Montoro

There seems to be many developers that think if you are not doing JavaScript, you are not really developing. Based on that (mis)conception, it is natural to use JavaScript to simplify (more like "JavaScriptify") what other languages like HTML, CSS, or a server side language can (and should) do.

Don't take me wrong, JavaScript is essential nowadays. It is convenient being able to do many things in a single language, but many times it's at the cost of performance and complexity –even when the solution claims to remove complexity, what it ultimately does is adding a new layer of abstraction... which leads to more complexity.

If you enjoy Go, do Go. If you enjoy Rust, do Rust. And remember: you don't need to love a language or marry it (although specializing in a language will give your career a nice boost), just to work with it.

Collapse
 
seandinan profile image
Sean Dinan

In my opinion, I would say it's because the world runs on the internet and JavaScript is essentially the only programming language available in-browser.

That does seem to be changing as WebAssembly gains momentum. Not sure if you're already familiar with it, but it might be of interest if you want to branch out into other languages (e.g. Rust, C/C++, C#) while still developing web applications.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.