Programming fundamentals and introduction to JavaScript

Srijan } Author Pic
SrijanMar 21, 2025 - JavaScript
Programming fundamentals and introduction to JavaScript - Reacted Node

Photo: Pexel/Pixabay

What is Programming?

Programming is about giving instructions to a machine, typically a computer, to perform specific tasks. You can think of it as providing a set of directions to someone driving to reach a particular destination or providing a chef with a recipe to prepare a specific dish.

Instructions and Algorithms

Computers are machines that follow instructions.

Computers are designed to perform a sequence of operations. These operations are called instructions. For example, add numbers 4 and 5, store value 7 in memory, or display sum of numbers 4 and 5 on the screen.

We generally need more than one instruction to complete a task. For example, the chef needs to follow the recipe to make tea.

The recipe here can be considered a set of instructions that a chef can follow in the specified order to make the tea:

1Boil water.
2Put a tea bag in a cup.
3Pour the hot water into the cup.
4Let it steep for a few minutes.
5Add milk or sugar. (according to taste)

A well-defined sequence of instructions that is designed to solve a particular problem or accomplish a specific task like "make a cup of tea" is what we call an algorithm.

Thus, an algorithm is a logical and ordered set of steps that, if followed correctly, will lead to the desired outcome.

The role of programming language

We humans communicate using natural languages like English, Hindi, Spanish, etc. On the other hand, computers at their lowest level understand a language of 0s and 1s called machine code or binary code.

Using binary code to give instructions to computers is not feasible for humans, as it is difficult for us to write and read codes in 0s and 1s. This is where programming language comes in. It bridges the gap between human-understandable instructions and machine code.

A programming language acts as an intermediary. It provides a set of rules, vocabulary, and syntax that are more human-readable and writable than machine code.

A program written in a programming language will need special software to translate the instructions into machine code. These special software are called compilers or interpreters, depending on how they translate the code into machine language.

Some programming languages are closer to machine language, like Assembly, and are called low-level languages. At the same time, others are further removed and focus on expressing logic in a more human-like way, like JavaScript, Python, etc, and are called high-level languages.

Introduction to JavaScript

Web pages were mainly static documents in the early days of the web. There was no standard way to make web pages interactive and respond to user interactions directly within the browser.

In 1995, Brenden Eich created JavaScript to add interactivity to the web pages running in the user's browser.

The goal of JavaScript was to:

  • Respond to user actions like button clicks, mouse movements, and form submissions.
  • Manipulate the content and appearance of the web page without requiring a full page reload.
  • Validate user input before sending it to the server.

JavaScript's capability grew again in 2009 with the introduction of Node.js, covering the whole development stack - developers can now use JavaScript to add interactivity to the webpages and write server logic, too.

In the present day, JavaScript is one of the most widely used programming languages. It is not only used for full-stack development but also for desktop and mobile app development, game development, and much more.