Intro to Javascript

John Peter
3 min readJan 6, 2020

--

Javascript usually abbreviated as JS is being used everywhere nowadays from browsers to servers and has a variety of use cases in the real world. It is the most misunderstood language and the most criticized language. I agree it is not as performant as the other languages available but when used properly I think it is one of the most easy to understand and adopt. And a lot of work is being going on to improve the language. The general characteristics and the most important ones of JS are as follows

  1. High Level language
  2. Just in time compiled
  3. Multi Paradigm

We will discuss each of them on what is actually means.

High Level Language

The computer / mobile you have will follow specific architecture like x86, ARM. These are called computer architectures which are nothing but a set of commands that the computer is capable of performing. Programming languages are an abstraction over these architectural commands. Every programming language has a step called compiling step that will convert the programming languagues abstraction into the architecture specific commands for executing it. Based on how these abstractions are done the programming languages are converted into three types as low, medium and high level languages. High level languages tend to be more human readable and this human readable capability decreases as we go down the hierarchy from high to low level programming languages. Recently there are other classifications like Very High Level, Fourth generation and Fifth generation programming languages. I am not going to discuss them as they are beyond the scope of this blog. So Javascript falls under the category of high level language since its abstractions are more human readable and understandable.

Just in time compiled

As discussed before every programming language has a step called compiling to convert its abstraction into the underlying machine’s architecture commands. Based on when this compiling operation takes place the programming languages are classified as

  1. Just In Time (JIT) / Run-Time compiled
  2. Ahead Of Time (AOT) compiled

JIT compiled languages converts its source code to underlying machine’s architecture commands only when the user executes his/her program. Whereas for AOT compiled languages the programmer has to convert his/her program beforehand to execute it.

Since AOT programming languages compiles their program before hand they will not incur the time required for compilation in their program execution time. But programming languages based on JIT will incur this compilation time overhead in their program execution times.

Multi Paradigm

Paradigms are set of rules to be followed to solve a problem at hand. Each programming language has to follow some kind of paradigm while solving a problem. Programming paradigm is a very large topic and would recommend you to read the following article from GeeksforGeeks. So basically there are different paradigms that can be followed while solving a problem and some programming languages allows only one paradigm to be used in them while others allows multiple paradigms to be used.

Javascript falls under the second category. You can write code using Imperative programming paradigm or declarative programming paradigm. The programmer is given the freedom to use whatever paradigm that suits the current problem at hand. This freedom is what makes javascript very powerful and one of the reason for its high adoption among the developer community.

These are the general things I wanted to cover as an intro to javascript. Thanks for reading.

--

--

John Peter

Senior Software Engineer — Frontend @Freshworks.