Javascript usage in today’s world

Tirth Patel
6 min readJun 17, 2021

A few years ago, I couldn’t tell the difference between server and client-side development. Vue.js, React, Node.js… what the hell? I couldn’t begin to understand why JavaScript was everywhere, why it was so important. So, lets start understanding what actually is Javascript.

What is JavaScript?

When you’re new to something, you usually search for definitions and end up in Wikipedia. In JavaScript case, you might end up with more questions than you came in with. You’ll hear and read a lot that it’s a client-side programming language, which is true. But is also kind of diminutive to what JavaScript actually is today. For now, let’s simply say that JavaScript is a tool for developers to add interactivity to websites.

Your browser needs three things for allowing you to consume this content:

  • HTML structures the content
  • CSS styles it
  • JavaScript makes it come to life!

This makes it all sound straightforward, but trust me, there’s so much more to it.

Why does the web need it?

Why did Netscape need a whole new language for the web, wasn’t Java enough?

The perception at that time was that Java was not suited for an entire audience that could potentially adopt web development such as scripters, amateurs & designers. It was just too big for the role. With the coming of JavaScript, it was possible to satisfy different audiences: 1) component writers and enterprise-level professionals with Java and 2) scripters & designers with JavaScript. That second bunch we could also call, in modern web dev terms, frontend developers. The name JavaScript came from an attempt to ride the wave of Java’s popularity and speed up adoption. Today, you won’t find many similarities between both languages.

Here are a few things you see every time you spend two minutes on a web browser, that are the result of JavaScript:

  • Autocomplete
  • Loading new content or data onto the page without reloading the page
  • Rollover effects and dropdown menus
  • Animating page elements such as fading, resizing or relocating
  • Playing audio and video
  • Validating input from forms etc.

JavaScript is a scripting language that’s inserted directly in the HTML of a page. It’s the only programming language of this kind that can be understood by web browsers. Browsers can read Javascript, interpret it and then run the program, creating powerful client-side experiences. It’s well-suited to the web with its dynamic nature and tight integration with the DOM.

JavaScript also is compatible with other languages. This is super important as web servers run on different languages whether it’s PHP, Python, Ruby, Java or .NET. Because the JavaScript running in the browser is 100% decoupled from how HTML web pages are generated, users will always have the same rich experience as JS works, no matter the server-side language used.

Why is JavaScript so important & Language of the now powerful frontend.

For a long time, websites were mostly powered by PHP-based CMSs, such as WordPress. Server-side code was handling the major part of the logic. Things are changing though — you might have heard that “static” sites are making a comeback. However, they’re nothing like the ’90s statically generated websites I mentioned earlier.

Modern browsers now have the capacity to make these interactive and fully-dynamic. A particularity they share with their ancestors, though, is the abstraction of backend development. Logic is handled client-side, directly in the browser, thanks to JavaScript. Some of the most prominent web applications around today are built using JS. Think Facebook, Gmail, Twitter, and many more. If we use Facebook as an example, JavaScript enables status updates and most user interactivity. It wouldn’t have much appeal without it. These tech giants actually built their own frameworks of JavaScript, and these now allow thousands of devs to build their own web apps. You might have heard of Angular, backed by Google, and React, backed by FB. I also have to mention Vue here that, even if not supported by a tech powerhouse, completes the triad of important JS frameworks.

It’s now easier than before to use JavaScript to connect to mobile APIs though. This means that you can use mobile devices features, such as the camera or localization to build JS-powered apps. Once again, this opened mobile app development to a more significant number of developers who no longer need to learn a new language. Not only this, but the use of JavaScript in mobile apps even opened up new possibilities to make them even more performant. Take a look at Progressive Web Apps (PWA) for instance. Combining the best of the web and the best of apps, PWAs improve reliability, performance, and engagement. They enable impressive new functionalities such as offline navigation.

JavaScript benefits

  • Client-side execution of the logic brings faster user experiences. With the code running directly in the browser, the need for server calls is abstracted, hence a cut in loading times. Even with the presence of a server, the fact that JS is asynchronous means that it’s able to communicate with the server in the background without interrupting the user interaction taking place in the frontend.
  • Since the very beginning, JavaScript has brought user interface interactivity to the web. It now does the same for applications of all kind, helping to develop the most engaging UX. Today, frameworks like Vue.js are bringing transitions & animations to the next level.
  • JavaScript is behind any good responsive web design. More and more, developers need to adapt their design across multiple browsers and devices. Combining HTML5, CSS3 & JavaScript, they can do so within a single codebase.
  • For developers, JS is easy to learn and fast to get into active development. Its syntax is easy and flexible for newcomers. It also simplifies the development of complex applications by enabling developers to simplify the app’s composition. The many frameworks & packages out there also ease the life of developers to some extent.
  • If you haven’t got this yet, JavaScript is insanely popular. If popularity doesn’t always equal quality in life in general, it at least mean one important thing: you’ll find the solution to any problem within the community. In web development, that’s not a negligible detail. If you’re someone that needs to hire developers, that’s also a big plus, as the pool of candidates is huge.

JavaScript is ever evolving, and so is its ecosystem. I personally think the future begins with less new tools being created and the big players getting more mature and gaining major adoption. We’re already observing this in the field of JS frameworks, where React and Vue.js are taking the edge. Same at other levels where tools are built on these frameworks. Gatsby, Next.js & Nuxt are slowly becoming the leading static site & PWA generators.

TypeScript will probably play a big part in what’s to come as well. This superset of JavaScript is being adopted massively by the community because it allows JS to scale better. The future holds many things in the tech world that will no doubt have an influence on frontend development, such as Artificial Intelligence or the Internet-of-Things. JavaScript will have to adapt to these new realities.

One thing’s for sure, if you want to stay relevant in this field, you should never stop learning new stuff!

--

--