Javascript?: Industry Usecases

Javascript: Industry Usecases



What is JavaScript, and why is it important?

JavaScript is a programming language?used primarily by Web browsers to create a dynamic and interactive experience for the user. Most of the functions and applications that make the Internet indispensable to modern life are coded in some form of JavaScript.


For many years, JavaScript only functioned on a limited number of browsers. Microsoft's Internet Explorer, the largest browser base, did not support JavaScript until much later. Instead, Microsoft created its own proprietary client-side script called JScript. In the early days of?Web development, programmers who wished to create dynamic websites were often forced to choose one browser family over the other. This was less than ideal because it made the Internet less universally accessible.

No alt text provided for this image

JavaScript did not become standardized and widely adopted until 1999. Even after standardization, browser compatibility remained an issue for over a decade.



How does JavaScipt work?
No alt text provided for this image

JavaScript is what is known as a client-side script. Most Web applications,?such as a search engine, work because of an interaction between the user's device (e.g. computer,?phone, or tablet) and a remote server. The software on the remote server sends information to the client (i.e. the user's machine) and the software on the client-side reads the information and renders a Web page on the screen. A client-side script is a programming language that performs its tasks entirely on the client's machine and does not need to interact with the server to function. For instance, if you have a Web page loaded on your computer and your Internet service provider goes down, you are still able to interact with the Web pages already loaded on your browser. You will not, however, be able to navigate to new Web pages or access any data located remotely.

Some of the dynamic website enhancements performed by JavaScript are:

  • 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 Webforms

While JavaScript is a client-side language, some of its most powerful features involve asynchronous interaction with a remote server. Asynchronous simply means that JavaScript is able to communicate with the server in the background without interrupting the user interaction taking place in the foreground. In the background, JavaScript reads the letters as the user types, sends those letters to a remote server and the server sends suggestions back.

The software on the server-side analyzes the words and runs algorithms to anticipate the user's search term. Such programs are diabolically large and complex. The JavaScript on the client's machine is as simple and small as possible so as not to slow down the user's interaction. The communication between JavaScript and the server-side program is limited by the user's bandwidth. This is why developers prioritize efficiency in JavaScript functions and make the amount of data communicated between the programs as small as possible.

Only once the user selects a search term does the entire page reload and produce the search results. Engines such as Google have reduced or eliminated the need to reload, even for that step. They simply produce results using the same asynchronous process.


How does JavaScript make working so easy?

  • JavaScript evolved more than what we saw now; it will continue to evolve and will have more feature in the future.
  • Recent development like React, React Native showed us how they could be super effective used.
  • In recent years it is modified to run in a server environment (node.js). Frontend developer can easily understand the backend, so a developer from a frontend background and understand the logic of the backend easily.
  • This language is an old pal. It’s been here for many years, and it will continue to be here, and its community is very big, so you get good support.
  • Many frameworks and libraries are developed using core JavaScript, which makes common functionalities easy to implement.
  • It is a?dynamic language designed to optimize programmer efficiency, so you can implement functionality with less code.


Why do we Need JavaScript?

  1. When you?compile?a?language, it will be?converted?into?native code, and?native code cannot?be?executed?by?other computers?with?different CPU architectures.
  2. But?scripting language?is?written?to?compile?by other?programs, like a?browser. So,?send?it as a?code?to?any browser, which then?reads?it?line by line?and?interprets?and?executes it.
  3. JavaScript translates your static page into one that can interact with your visitors without them needing to wait for a new page to load every time they make a request. JavaScript adds?behavior?to the web page where the page responds to actions without needing to load a new page to process the request.
  4. JavaScript also allows your page to be interactive in other ways that do not involve forms at all. You can add animations to the page that either attracts attention to a specific part of the page or make the page easier to use. You can provide responses within the web page to various actions that your visitor takes so as to avoid the need to load new web pages to respond. You can even have the JavaScript load new images, objects, or?scripts into the web page?without needing to reload the entire page. There is even a way for JavaScript to pass requests back to the server and handle responses from the server without the need for loading new pages.



Some Popular JavaScript frameworks

1. React JS:-?React is an open-source front-end JavaScript library that is used for building user interfaces or UI components. React can be used as a base in the development of single-page or mobile applications.

2. Angular JS:-?Angular js is a typescript web application framework. Angular helps build interactive and dynamic single-page applications with its compelling features including templating,

No alt text provided for this image

3. Vue JS:-?Vue JS is a progressive framework. it is used to build web interfaces and one-page applications. Not for web interfaces,?Vue.?js?is also?used?both for desktop and mobile app development.

4. Node JS:-?Node.js is an open-source server-side runtime environment built on Chrome’s V8 JavaScript engine. Node.js can be used to build different types of applications such as command-line applications, web applications, real-time chat applications, etc.




Let's See How Major Companies Are Using JavaScript...


No alt text provided for this image

  1. Microsoft:

Microsoft needs to work closely with JavaScript to built its Edge web browser. All browsers need to process and execute JavaScript efficiently, so Microsoft has developed and maintains its own JavaScript engine for Edge. Actually, there has been talking of them creating an alternate version of NodeJS with the Edge engine.

Recently, Microsoft has really embraced NodeJS. They thoroughly support Node on the Azure cloud platform. It's one of Azure’s major features, and they’ve integrated Visual Studio support for Node.

Microsoft has also developed a version of Node for?Internet?Of?Things(IoT) applications. NodeJS is great for IoT because it’s lightweight and efficient.


2. PayPal:

PayPal has obviously been using JavaScript on the front end of their website for a long time, but that’s only the beginning.

The online payment giant was one of the earliest adopters of NodeJS. During an overhaul of their account overview page, they decided to try building the page in Node at the same time as their usual Java development. The NodeJS version worked out so well, that they chose to use it in production and build all client-facing applications in Node going forward. That means that most of what you see in your account is running on Node.

PayPal even went as far as to create and maintain their own version of Express, called?KrakenJS. It’s pretty obvious that they like JavaScript over at PayPal.


No alt text provided for this image

3. Netflix:

Like PayPal, Netflix started out using Java for just about everything. They too ran into problems with Java’s size and the time it required to develop.

Over time, Netflix moved away from its more traditional structure into the cloud and started to introduce NodeJS. With Node, Netflix was able to break down pieces of their user interface into individual services. This more distributed approach was able to speed things up and alleviate stress on their servers. Today, a large portion of Netflix’s interface is running on Node.

Netflix is the world’s supplier of flowing broadcast and television. Netflix is the world’s top supplier of flowing broadcast and television. The company decided to embrace fast and easy Node.JS.

Earlier, Netflix was using Java on the back end and JavaScript on the front end, which required the developers to be proficient with languages.

As a result, they had to do double work for error handling, activity tracking, and debugging.

Netflix is now among companies using Node.JS due to the following reasons:

  • A common language both for the server-side and browser side.
  • High performance — now the page loads within seconds.
  • A great number of modules and their open-source nature.
  • An easy way of writing, debugging, and engineering the API.

The team behind Netflix.com has switched from a Java-based HTML renderer to a JavaScript one that they can run on both the server and the client.

To decrease the time users spent waiting, Netflix has removed the Java server-based renderer and reduced the amount of HTML sent down the wire.


4. Groupon:

Groupon used to be infamously slow. Why? They were powered by Ruby on Rails. That’s the same framework that brought you the Twitter fail whale.

Groupon was all one gigantic Ruby on Rails application. Thanks to difficulties in speed and maintainability, they decided to change over to NodeJS. Node allowed Groupon to rebuild its entire US website by breaking down everything into individual NodeJS web applications. Now, Groupon is made up of over 20 Node applications, and it moves much faster as a whole.

Groupon is currently moving all of its international sites to NodeJS and has joined the NodeJS Foundation. It’s pretty clear that they are happy with their change.


No alt text provided for this image

5. Uber:

Uber needs to handle loads of data in real-time. They have millions of requests coming in continuously, and that does not just hit on a page. Uber needs to track driver locations, rider locations, and incoming ride requests. It has to seamlessly sort that data and match riders as fast as possible.

All of that plays to NodeJS’s and JavaScript’s strengths. Node is designed to handle requests and handoff data quickly. Its asynchronous capabilities are a huge part of that. Node is central to Uber’s user-facing stack for just that reason.



No alt text provided for this image

6. Facebook:

You’re probably aware that Facebook uses JavaScript. It’s kind of hard to miss. What’s probably not as obvious is exactly how much JavaScript goes into making Facebook and how much Facebook is involved in JavaScript development.

Try disabling JavaScript in your web browser and going to Facebook. The website will actually stop you from logging in because it won’t work without JavaScript.

You may have noticed the way that Facebook loads. Each piece of the page is separate. Facebook has invented its own way of breaking down and delivering sections of JavaScript separately. In an odd way, each section of your Facebook page is a collection of independent JavaScript applications.

It doesn’t stop there. Facebook created?React, one of the most popular front-end frameworks. Facebook uses React on Facebook.com as well as Instagram and WhatsApp.


No alt text provided for this image

7. Google:

How doesn’t Google use JavaScript? Seriously, it’s everywhere. Google’s search results spring up as your typing gets there with JavaScript. The Gmail web client is powered by JavaScript. Google Docs? Yeah, that’s JavaScript too.

Google develops and usually opens sources its own JavaScript tools. The most obvious example is AngularJS. Angular is used most prominently in Google’s DoubleClick advertising platform, but it’s also one of the most popular front-end frameworks available. It’s even part of the MEAN stack.

Google’s more intensive services, like Google Docs, use Closure Tools. This set of tools compiles JavaScript into a lower-level faster form more suited for rich and highly responsive web applications.

There’s another big point to touch on. Google developed Chrome. Chrome is a web browser, needed a JavaScript engine, so Google also made V8. V8 not only powers Chrome, it’s at the heart of NodeJS. So, without Google, there would be no Node.


8. eBay:

eBay’s story is a lot like Netflix’s. For a long time, just about everything in eBay’s tech stack was based on Java. A few years ago, eBay encountered a problem that Java wasn’t the right solution for. They decided to give NodeJS a shot instead.

Node worked so well that eBay not only kept using it for that particular service, they began migrating their entire user-facing stack to NodeJS. Now, just about everything that you interact with on eBay is powered by Node. Sure, beneath Node, Java is still dealing with their databases, but eBay still places a lot of trust in NodeJS.


No alt text provided for this image

9. Walmart:

Most people probably don’t think of Walmart as a tech company, but because they’re one of the largest retailers in the world, their online retail business is gigantic. It’s not much of a stretch to see how they need to build a technologically advanced web application to drive their online business.

Walmart started out with Java. It’s a solid enterprise-grade platform that has been the de facto choice for years. However, Walmart needed something faster and lighter weight for their mobile site. So, they turned to NodeJS.

Once again, Walmart began to see Node as a valid Java replacement in loads of other places. Today, the Walmart.com that you see is powered by Node. NodeJS was also the ideal choice for other web applications within their marketplace that require multiple users to be able to access management interfaces simultaneously.


No alt text provided for this image

10. LinkedIn:

LinkedIn relies on NodeJS for its mobile site. A few years back, LinkedIn used Rails for its mobile site. As with other large Rails applications, it was slow, monolithic, and it scaled poorly.

LinkedIn switched over to NodeJS to solve its scaling problems. Node’s asynchronous capabilities allowed the LinkedIn mobile site to perform more quickly than before while using fewer resources. Node also made data sharing and building APIs easier for LinkedIn developers.



Conclusion

The principal reason is that JavaScript has managed to grab the most mindshare in the web programming community. Ten years ago, it was the only language that was native to the web browser, so web developers had no choice unless they wanted to use CoffeeScript. Since then, JavaScript has built up an enormous ecosystem of tools for web development, as well as a large user community. This made it a convenient and practical choice for tech companies.

Shrishti Kapoor

Cognizant | 4 x RedHat Certified | Aviatrix Certified Engineer | AI-900 | Technical Trainer | IIEC-DOT Volunteer | Technical Research Writer Enthusiast..!! ??DevOps ??Cloud-AWS, Azure ??ML/AI/DL

3 年

Well Explained ??

要查看或添加评论,请登录

Ajeenkya S.的更多文章

社区洞察

其他会员也浏览了