- - Why is it so important?
- - What’s coming for JS?
You will hear and read a lot that it is a client-side programming language, which is true but does not quite adequately gives it the merit it deserves today. We’ll come back to this later on.
Your browser needs three things to consume this content:
- HTML for structuring the content
- CSSfor styling it
This makes it all sound straightforward, but there’s so much more to it. In order to get an overview, let’s start by going back in time.
Back then, the web was fully-static, powered by simple HTML & CSS. JS brought dynamism.
Even after the death of Navigator, it was eventually adopted by all succeeding web browsers, from Explorer to Firefox and Chrome.
Why does the web need it?
Up to this point, one question that might stick is -
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.
- 1) component writers and enterprise-level professionals with Java
That second bunch we could also call, in modern web dev terms, frontend developers.
The name Java Script 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.
- 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 - and a lot more
It achieved this status because it’s open, standardized, and, most importantly, whether you agree or not, a very good language. It’s well-suited to the web with its dynamic nature and tight integration with theDOM
Why is that?
For answers, we need to look at the amazing ecosystem that was built on it. Some might sight the good old “chicken and egg” paradox here.
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 very rapidly.
Modern web trends were born from this new paradigm, like the JAMstack.
Some of the most prominent web applications around today are built using JS. Think Face-book, Gmail, Twitter,
, backed by Google, and React
, backed by FB. And an upcoming rival Vue
not supported by any of tech powerhouse, completes the triumvirate of important JS frameworks
Other than reducing the amount of time and efforts required for developing JS-based sites and apps, these frameworks helped shape new web experiences. Take Single-Page Applications (SPA), for instance. A SPA is a website that interacts with users by dynamically rewriting a page in the browser rather than loading entire new pages from a server, making them behave more like desktop applications.
Language of many things
Once again, this opened mobile app development to a more significant number of developers who no longer need to learn a new language.
Aforementioned frameworks like Vue.js and React are increasingly used to craft PWAs. You should check it out!
But wait for a second here, this whole story doesn’t matter if it doesn’t bring benefits to developers and end-users.
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 at the frontend.
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.
Does this mean that JS is perfect?
Not at all, there are indeed disadvantages to be aware of just like any other language.
The thousands of packages that constitute the JS ecosystem allow developers to work quickly without reinventing the wheel for each new task. However, they also cause what some have called “dependency hell.” You need to learn how to deal with these often necessary dependencies, so they don’t become a hassle for you and the people using your projects.
What is in the horizon for JS?
Same at other levels where tools are built on these frameworks. Gatsby, Next.js & Nuxt are slowly becoming the leading static site & PWA generators.
Technology Always In A Flux
As developers, technology is in a constant state of change and flux. Every year, something new and groundbreaking eventually makes its way to center stage — mostly because the communities and people behind them identified a gap or unsolved problem in the solutions currently available.
It’s the way innovation works — but sometimes it can be hard to keep up with everything. Our ability to adapt to requirements determines how well we will continue to thrive and create useful products for our clients.
As mentioned earlier, nothing lasts forever and eventually, all things will fade into obscurity and be replaced by new ones. But for now, JS is riding the wave. With the number of applications being integrated and built with its many libraries, it’s probably going to stay for a while.
See The Power Of JS