15 OCT 2021

Javascript: an introduction to the most commonly used programming language

by Trudo

JavaScript, followed by HTML and Python, is one of the most commonly used programming languages within the software development world. "According to Stack Overflow's 2020 Developer Survey, JavaScript currently stands as the most commonly-used language in the world (69.7%)"

JavaScript’s programs are called scripts, hence the name. These scripts are usually written on a webpage’s HTML as plain text, and they will run as soon as the page loads, since the scripts do not need extra preparation to run.

SO WHY IS THIS SO COMMON?

We can start with explaining a little about how and why it's used. JavaScript is mostly used for creating websites and webpages. It gives webpages the dynamic content with which we interact. It's also used for validation purposes on websites.
Basically, anything you can see moving, adding images, videos, carousels, and forms, everytime content updates, interactive maps, animations, you know that JavaScript is involved.
JavaScript is mostly used as a front-end language and helps developers to execute complex actions, and also allows the interaction of the developer with the visitors and users of the website and webpage.
As it's mostly used as a front-end language, it's very often paired or stacked up with other back-end frameworks or webpage technologies, which usually are HTML, CSS, or others like Node.js.
JavaScript’s programs are called scripts, hence the name. These scripts are usually written on a webpage’s HTML as plain text, and they will run as soon as the page loads, since the scripts do not need extra preparation to run.
Currently, JavaScript is developed as a language with its own specification to which it conforms to, which is called the EMCAScript, which is a general-purpose programming language, and it’s considered to be the blueprint to JavaScript, or any other scripting language.

The way this language acts depends a lot on which environment it’s running in, and if it’s in-browser.

WHAT CAN IT EXACTLY DO?

With Node.js, JavaScript is able to read and write files, perform network requests and so on, while for example if it’s in-browser, JavaScript is able to react to users actions, send requests over to remote servers and download and upload files, it can add new HTML to the page and modify the styles, remember data on the client side, which means it has local storage.
A huge benefit is that there are a lot of languages that have a lot of features that JavaScript doesn’t, and can actually be converted into JavaScript.
So if the syntax of it doesn’t necessarily fit your needs, you can use languages such as CoffeeScript, introduces shorter syntax, Flow, adds another method in data typing, TypeScript, concentrated on strict data typing to simplify development of more complicated systems, Brython, Python transpiler.

WHAT ARE THE DOWNSIDES?

There are a few downsides too, which can include lack of communication or receiving data from other domains, even though it can very easily communicate over the net to the server where the current page came from.
JavaScript also does not have direct access to OS functions, so it cannot read and write over arbitrary files on the hard disk, so it won’t be able to execute functions from them.
A pro of this is that JavaScript cannot access cameras and microphones of a device very easily, it can be managed with specific instruction, but it can never be accessed without the user’s explicit permission, which creates another layer of security for users in all webpages built by JavaScript.
We guess what makes JavaScript so unique and easy to use, one of the developer’s favorites are these main reasons:
- It has full integration with HTML and CSS
- It does not complicate simple things. Anything which is a simple command is done and executed simply.
- It supports all major browsers and it can be enabled by default.

Besides all of these, which we focus on how great JavaScript is on building web pages, we have to mention that it is also used to create servers and mobile applications.