JavaScript – Language of the Web

JavaScript – Language of the Web

JavaScript is one of many client side-scripting languages (other examples being VBScript, Jscript, etc.) that improve the functionality of a webpage or a website. When you access a webpage on the Internet, using a browser, there are two entities involved – the client and the server. The client is the device that you use to access the internet, and can be your PC, laptop, or mobile. The server – which is another computer – is the one that stores the data and provides it to you when you ask for it. Here is how it works:

  1. Your browser will send a request to the server for the content
  2. The server will process the request and find the content needed
  3. The server will sent the content back to the client
  4. The client will process the content and render it to your screen

JavaScript is a multi-paradigm language that supports event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles. In simple English, it is the language of the web. While it can be used server side, it is mainly used as a client side programming language that is implemented as part of a web browser to allow developers an improved way to implement user interface and dynamic features in web pages. However, it is increasingly used on the server side too nowadays. JavaScript is an interpreted programming language, built on the ECMAScript standard. The name was coined by Netscape, a popular browser of the 1990s. The name is highly confusing though, as JavaScript has nothing to do with Java. They are not related and have different purposes. JavaScript has become almost ubiquitous because of its utility. One of the most basic usages of JavaScript is form validation. Say you are required to fill a form, and make a mistake of entering alphabets in the phone number field. Before JavaScript, the data used to go to the server, where it was verified for integrity. If any error was found (like entering alphabets in the phone number), the form was send back to the user without getting submitted. The whole process was tedious, especially since internet speed was slow and modems ruled. With client side JavaScript in place such errors are caught even before the data reaches the servers, resulting in faster processing speed. Since the server does not need to check the data integrity, it improved website speeds too. Checking forms for errors may not seem like a big task, but when many people interacted with the website at the same time and websites were deployed on simple servers (and not deployed on cloud, as today’s traffic intensive sites are), the performance was affected significantly.

Today, JavaScript is invariably present in all webpages, and is almost as common as HTML and CSS. It is a scripting language, and has its own syntax. The main power of JavaScript lies in its ability to change HTML content. For example, you can use it to display different content on the click of a button. Not only that, JavaScript that change the attributes of HTML, dynamically change the CSS, hide or show HTML elements, or can be used to animate webpages. In simple words, JavaScript is so popular because it is fun; it transforms boring static pages into something more appealing. However, JavaScript applications are not restricted to make webpage more attractive and interactive; it can also be used outside browsers. For example, as a way to add interactivity to PDF document and desktop widgets.

Because it is utilitarian, most of the modern browsers like Internet Explorer, Firefox, Chrome, and Opera come with built-in support for JavaScript. However, in case the browsing speed is slow (can happen rarely today, but yes it can), you can enable or disable it from your browser settings. Since it involves coding, there is also a chance that an improperly tested / implemented JavaScript can cause the browser to crash, so the option of disabling JavaScript can sometimes comes in handy. In addition, different browsers support JavaScript differently. If you decide to make a career in JavaScript coding, you will understand that while learning and implementing JavaScript is easy, fixing cross browser compatibility issues is an ardous task. JavaScript commands are quite similar to C, but many of the naming conventions are derived from Java. However, that is where the similarity ends.

Writing JavaScript is easy; all you need is a simple text-editing program like Notepad. However, if you are looking at JavaScript as a career choice, you will most certainly need to learn a framework or two, to make your work safer and speedier.

JavaScript Frameworks
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate development of software applications, products and solutions. Software frameworks may include support programs, compilers, code libraries, tool sets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or system. In simple words, a framework provides the infrastructure using which details are filled in. JavaScript framework is an application framework written in JavaScript where the programmers can manipulate the functions and use them for their convenience.  There are many effective JavaScript out there today; which framework you choose depends on the requirements and your comfort level.

As of 2021, a few of the popular JavaScript frameworks are Angular JS, React, Node JS (not exactly a framework but a runtime environment), Ember and Vue JS. This list is not exhaustive by any means, and there are many other worthy JavaScript frameworks; we have mentioned these as they are among the most popular ones. Again, while they are similar in many ways, there is a subtle difference between each of the frameworks, so you need to choose a framework that will suit your needs.

 If you are interested in learning JavaScript either for a specific project or as a career choice, there are several resources available, either in form of online tutorials or as a book. Just check for a suitable resource using a search engine.