More articles

What does the future of JavaScript look like?

Written by
Filed under
Published on

It wasn't that long ago that JavaScript was shunned in the coding community as a small-time scripting language used mainly to hide and show elements on a page and to change colors on the fly. Which was pretty cool for its time mind you. This was a time when the internet was mainly a blocky and small fonted space with very low resolution images. So having any form of movement or color was much welcomed.

New specifications brought new abilities, such as better DOM manipulation and much needed performance updates. This allowed for smoother animations and just far more control over a webpages design.

Ajax steps into the picture

The biggest highlight to JavaScript came with the concept of asynchronous calls over the web browser. This meant that pages no longer had to be submitted and refreshed in order to send data over to the server. Which was both a pain to the site visitors and to the developers as well as they had to come up with clever ways to store the data in between these refreshes. Just imagine that a user forgot to add that precious secure 'number' to the password field. The request package would go to the server and come back as not acceptable, and then you had to refill every input box somehow. Most websites didn't bother to, so you had to re-enter all of your data once again. No longer a real issue these days, but despite what many believe, storing state back in the day was a tedious process and required some hefty code.

Back to Ajax. The ability to not have to refresh pages was pretty much like a brand new drawing canvas with plenty of potential. And people made use of it. Single-page applications became all of the craze for some time. Companies were completely rebranding themselves at this point with new sleek designs. That is until they realized that having just a single page was terrible for SEO and many of those companies lost their traffic and probably went out of business.

Server side JavaScript

If Ajax flipped the game completely around for web designers and developers, server-side JavaScript would be the next milestone that the language would hit. During its first phase, JavaScript was pretty much still just a front-end facing language that ran on the users browser. You still needed some form of server-side technology in order to do the heavy lifting and generate content. You needed another language such as PHP or C# or Java to render the actual page.

Then node.js hit the scene and things once again went up several levels. We could now build fully complex web applications using the same language that we were using to work on the front-end. From a cost perspective, this was pretty huge for many companies. Instead of hiring multiple developers to work on a website, you could now give that same workload to a single programmer, assuming they were familiar with Node.js or at the very minimum with JavaScript.

And if you think that it stops there and we're in the future, you haven't seen anything yet, so read on to see just what updates and improvements JavaScript continues to make.

3D Graphics

HTML5 brought with it a slew of new features and specifications, but the one that really stood out the most was the new <canvas> element. Before HTML5, it was possible to render animations and graphics on a webpage, though with some work and clever hacks. Sometimes a pixel by pixel approach was needed, and while definitely doable, the performance hit required to do fancy things was too high and most computers just couldn't handle it. Just imagine a million <div> elements moving around in real time in order to look like 3D content. Doable, but definitely not the most resource friendly process.

That is until the <canvas> element stepped in which allowed us to generate graphics directly on the browser using the native GPU and using a subset of openGL aptly named webGL.

With webGL it is possible to render fully 2D and 3D animated scenes directly on the browser from any device using just plain old JavaScript and without any type of plugins. And this is where things get interesting. We still think of the web as this static 2D environment with boxes and links of various shapes and colors. There are words and images present and we transcribe that into some form of meaning that help us in our day to day lives, whether with our jobs or by keeping us entertained for some time. But the potential for the web is pretty much limitless. You can say this. We haven't yet thought of how amazing it has the potential of becoming. If you want to experience just a small bit of what that looks like, check out this fantastic tech demo.

Real-time communication

The latest specifications to JavaScript allow for things such as real-time communication protocols. Things like audio and video sharing can now be handled by the browser with just a few lines of code. And while still somewhat young in its specification, it won't be long before talking online through your browser will become just second nature to us. Where customer support will be a click away and where we won't have to stop what we are doing in order to do so.

Currently chat applications are present and usable, with things such as Google Hangouts or Facebook messenger and such. But that's the crux of the problem. We still think of the ability to communicate verbally (or visually) online as a tool for either entertainment or for personal use, such as online gaming or talking to family. But if we think just a bit outside of that realm, we can come up with some pretty cool ideas.

The future looks bright

Like with most things, adoption rates take time to grow. While we have the ability to create 3D graphics and real-time communication applications directly on the web with a single language and a few scripting files, people are not ready just yet to begin to use these features on a day to day basis. Similar to how not every movie you watch is in a surround-sound and 4D environment. Eventually, we will get to a place where watching such things is normal, but for now, you have to schedule it in to your life and go to a movie theater that offers it.

In a similar fashion, if you want to experience a more futuristic looking internet, you have to go out and look for it.

If you are a web developer reading this, or interested in JavaScript, then it really does start with you however. Someone has to build these futuristic applications. So begin by looking at what others are building. Head on over to https://threejs.org/ and play around with a few of the examples and demos there. And start to look into the communication frameworks and come up with new and clever ways that no one has thought about just yet.

If you have any ideas for some cool JS applications that you'd like to share, comment down below and let's talk about it.

Walter Guevara is a Computer Scientist, software engineer, startup founder and currently mentors for a coding bootcamp. He has been creating software for the past 15 years.

Discussion / Comments / Questions

No messages posted yet

Add a comment

Send me your weekly newsletter filled with awesome ideas
Post comment