DEV Community

Cover image for Types of programming languages & basic Concepts for beginners
Krypton | Madhusudan Babar for Madhusudan Live

Posted on • Originally published at madhusudan.live on

Types of programming languages & basic Concepts for beginners

Are you fascinated by the computer programming? Do you have secret crush on the guys and girls who love to code? Ever wondeed what magic happens behind the scenes of these beautiful machines?

Well, I'm here for your rescue, I'll take you on the adventure of this computer programs wonderland. This is going to be a fun ride, so let's get started.

What is a programming language?

You might have heard it many of times, "We Live In Digital Age", this digital era is powered by nothing but the computers. We all know how dependent our life has became on these devices, today, we can't imagine a day without these devices.

Computers are initially built for performing the complex mathematical operations i.e. computation, hence the name computers. these computers are evolved with time and now they have become an integral part of our lives.

As the computers are best at performing various tasks, storing data, pocesssing it and retrieving when needed, however, we need to instruct the computers to do so. but as computers don't understand human language, that's where a programming language comes into picture.

A programming language is a set of a generic rules and grammar for computers. These rules are then used to instruct the computer. a set of instructions given to perform certain task is called as a program or application.

These instructions are processed by CPU - central processing unit, think of it like the brain of computer. We will come back to CPU later in this article.

Ok, so now you understood what is a programming language and why we need it, now let's discuss the types of programming languages.

Types of Programming languages

Classification of programming languages
Classification of programming languages

Programming languages are classified into mainly 3 categories:

  • Low Level Programming Languages
  • Medium Level Programming Languages
  • High Level Programming Languages

You may wonder, what kind of levels are these, right? Well, these are the difficulty levels for a computer.

Low Level Programming Languages : Low level programming languages are the easiest for a computer to understand, typically these are binary languages or hex codes. as the computers work on binary logic i.e. 0s and 1s, and so it's easier for the computers to process these languages. these instructions are the very specific to the hardware of the computer.

e.g.: Binary language, Hex codes

# binary representation of "Hello World!"

01001000 01100101 01101100 01101100 01101111 00100000
01010111 01101111 01110010 01101100 01100100 00100001
Enter fullscreen mode Exit fullscreen mode

Medium Level Programming Languages : Medium level programming languages are not so difficult, neither so easy, an example could be Assembly language. It is an intermediate programming language, which makes use of simple instructions, which can be understood by humans as well as the computer.

e.g.: Assembly language

section .text
    global _start

_start: ;entry point

    mov edx,len ;message length
    mov ecx,msg ;message to write
    mov ebx,1 ;output stream descriptor (stdout)
    mov eax,4 ;system call number (sys_write)
    int 0x80 ;call kernel

    mov eax,1 ;system call number (sys_exit)
    int 0x80 ;call kernel

section .data

msg db 'Hello, world!',0xa
len equ $ - msg ;length of our string
Enter fullscreen mode Exit fullscreen mode

High Level Programming Languages : High level programming languages allows a developer to think of the application rather than the hardware of the computer, these are the highest abstraction of hardware and the developer does not need to think of the hardware, architecture, etc. These languages use verbs similar to the ones we use to communicate.

e.g.: C, C++, Java

// example code in C
#include <stdio.h>
int main() {
   printf("Hello, World!");
   return 0;
}
Enter fullscreen mode Exit fullscreen mode

This how we classified the programming languages but now there are other criteria as well. but befor that we will discuss some important concepts that are used to further classify these programming languages.

There are other criteria to classify the programming languages, based on the features of programming languages:

  • Functional Programming Languages
  • Object-Oriented Programming Languages
  • Scripting or Interpreted Languages

Functional Programming Languages : Functional programming languages groups the reusable parts of a program, those groups are called as functions, hence the name. Functions returns the result of computation or perform certain tasks, these functions can be called from other functions as well as the same function.

Functional programming languages follows a top-down approach which means that the code starts the execution from very first line and continues till the last line from top to bottom.

e.g.: C

#include <stdio.h>
int main() {
   printf("Hello, World!");
   return 0;
}
Enter fullscreen mode Exit fullscreen mode

Object-Oriented Programming Languages : Object oriented programming languages or OOP are advanced version of programming languages, these languages groups the logically related functions and variables together in an Object. These languages defines a blueprint of the functionality i.e. class and these classes are instantiated to create the objects. OOP languages use bottom up approach.

e.g.: Java, C++

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
Enter fullscreen mode Exit fullscreen mode

Scripting or Interpreted Languages : Scripting languages are often used for small programs, mostly related to system, automation scripts, etc. these languages execute line by line and are generally used in computer terminals to interact with the system resources easily.

e.g.: Bash, Python, Javascript

# hello world in python
println("Hello World")
Enter fullscreen mode Exit fullscreen mode

Execution of code

Well to run a program or a piece of code, we need to go through some processes, these processes are different for different programming languages. In order to run the program, it needs to be properly translated to the machine level language, following are some of the common tools that ease this processs.

Assemblers

Assemblers take the assembly language code to the machine level language. assembly language is set of instructions called mnemonics which are fed to the assembler and translated into machine level language.

Advantages of assembly language : Assembly language is closer to the hardware and so one can access the system resources efficiently and easily work on the hardware level.

Compiler

Some Programming languages need to be processed before their execution, these processing is done by a compiler, a compiler takes the code and converts it into the machine level language depending on the hardware of that system. The compiler takes the entire codebase and converts it into the machine level language.

Hadware, here refers to the CPU architecture, instruction set and other low level details of a computer.

Advantages of compiled languages : Code gets compiled as a whole, so it generally runs faster, also the compiled executable file can be shared without need of sharing the original source code.

Interpreter

interpreter is also similar to the compliler, but the key difference here is the interpreter transates the code to machine language line by line, hence it reads, interprets and executes the lines sequentially, hence it is called as interpreter.

Advantages of interpreted languages : Interpreted code is easier to debug, since it executes line by line, the errors are catched easily, also it's more flexible as the changes can be implemented and tested easily without the need of recompilation every time.

Virtual Machines

Virtual machines are the virtual abstractions of actual physical hardware. these are software emulated implementation of different operating systems. Java uses this method to mimic the same environment on all the Operating systems. the VM is called as Java Virtual Machine, the Java code is firstly compiled into the bytecode and this bytecode is run using Java virtual Machine.

Advantages of JVM : Same code runs on all the operating system without any additional steps, creating the same environment on any platform / operating system.

Bonus

Well that's not everything, there are many other languages, that resemble like programming languages but they are not, such as HTML, Markdown, XML, etc.

The most popular HTML, which is the base of the internet is not a programming language but a markup language.Similarly there are markdown languages as well. I'll cover the basics of markdown in the next Article. stay tuned for more.

Conclusion

In the ever-evolving landscape of technology, programming languages serve as the bedrock upon which innovation thrives. As we conclude this exploration of programming languages, it's proven that these diverse tools are more than just strings of code; they encapsulate creativity, logic, and the power to transform ideas into reality.

From the simplicity of Python's readability to the robustness of Java, each language has its unique strengths. Whether it's the flexibility of JavaScript for web development or the efficiency of C++ for system-level programming, the choice of language often aligns with the problem at hand and the preferences of developers.

Arduino UNO Features Explained: Shields, IDE: Nano, ESP32

Tags:
programming

Top comments (1)

Collapse
 
launchbulls profile image
Launch Bulls

Okay I agree, with this. Especially with ESP32 mention. On the same thought we created a guide that is beginner friendly. Could you please check it out- khalsalabs.com/how-to-use-micropyt...