ENOTES

Types of programming language with examples

access_time Jan 27, 2022 remove_red_eye 1484

Computer is a dull machine, it needs instruction to perform certain task. We use different types of computer language generally known as programming language to instruct our computer. These programming language gives command to computer in the form of set of instruction. The collection of set of instruction are known as program which perform particular job. Several programs are written and integrated together to make a software. The person who writes program are called programmer. Programmer use different types of programming language depending upon the requirement of the user. Different programming language fulfills several purpose. Mainly, programming languages are categorized in low level language and high level language. But, they are further categorized into Machine level, Assembly language, procedural language, object oriented language and natural language which are also known as 1GL, 2GL, 3GL, 4GL and 5GL respectively.

Low level language

Low level language are machine dependent language that means program written in low level language for one processor may not execute on another processor. Moreover, programmer need to have detail knowledge about computer hardware architecture. It makes programming in low level language much more time consuming and difficult. There are two types of low level language. They are Machine level language (1GL) and Assembly language (2GL).

Machine level language (1GL)

Machine Level language is also known as first generation language (1GL). Since, MLL use machine code i.e Binary Digits (0 and 1) so, it is directly understood by the computer and doesn’t require any language translator. The program execution time in MLL is faster. MLL is also machine dependent which means programs written in machine level language for one type of processor doesn’t run on another processor.

Advantages of machine level language

  1. MLL is the only language which is directly understood by the computer.
  2. Since, it is directly understood, language processor is not required.
  3. Program execution is faster as no conversion is required.

Disadvantages of machine level language

  1. Program development is difficult and time-consuming.
  2. It is machine dependent, so program developed in MLL may not run on several other processor.
  3. Detail hardware architecture knowledge is required.

Assembly Language (2GL)

Assembly language also known as second generation language (2GL) is also the type of low level language which is very much closer to machine level language. In Assembly language we use mnemonics code i.e. instruction in the form of abbreviation such as ADD, SUB, DIV, JMP, STR instead of directly using Binary digits.  Since, Assembly language is not directly understood by the computer we use language processor such as assembler to convert program written in assembly language in machine level language. Here, program written in assembly language is source program whereas after conversion it becomes object program.

Advantages of assembly language

  1. Easier to remember codes compared to MLL.
  2. Program development and debugging is faster and easier.
  3. It can used to develop hardware oriented software.

Disadvantages of assembly language.

  1. Language translator is required as it is not directly understood by the computer.
  2. Since it is low level language, it is also machine dependent.
  3. Program execution time is slower compared to MLL.

High level language 

High level language are machine independent language that means program written in high level language for one processor can run on several other processor. Programmer don’t need to have detail knowledge about computer hardware architecture. It makes programming in high level language much more easier and efficient. High level language use instruction which is very closer and similar to English words and mathematical notations. There are three different types of high level language. They are Procedural oriented language (3GL), Object oriented language (4GL) and Natural language (5GL).

Procedural Oriented Language (3GL)

Procedural language also known as third generation language are commonly used high level language which primarily focus on process to solve a particular problem. The statement written in procedural oriented language follows top to bottom approach which means every statement written are executed sequentially from top left to right bottom. It used simple English like statements and mathematical notation which makes it easier to learn and use. Since, procedural language are primitive high level language they do not support advance modern features such as inheritance, polymorphism, encapsulation and so on. Program are divided into number of functions to solve several problem. C, FORTAN, BASIC, Pascal are some of the popular procedural oriented language.

Advantages of procedural oriented language 

  1. It is general purpose programming language.
  2. It is easier and faster to develop programs compared to low level language.
  3. Procedural language are advance and user friendly.
  4. It is machine independent which makes program deployment easier among large number of devices.

Disadvantages of procedural oriented language

  1. It need language translator such as compiler and interpreter to make it machine understandable.
  2. Program conversion makes its execution slower.
  3. It is difficult to develop hardware oriented program.

Object Oriented Language (4GL)

Object Oriented language generally known as problem oriented language is fourth generation language. It is often referred to as non-procedural language. Unlike procedural it doesn’t focus on process rather its primarily focuses on data. OOP main concept lies on class and object where, object consist of data and member function and class is comprised of similar objects. OOP are not executed sequentially rather they follow bottom up approach. Object Oriented language are the modern high level language so, it support several advance features such as data hiding, inheritance, polymorphism etc. C++, C#, PHP, Python etc are the widely used OOP.

Advantages of object oriented language

  1. Program development is faster as code can be reused.
  2. Used in web based application and game development
  3. Maintains high level of security features.

Disadvantages of object oriented language

  1. Language processor is required to execute the program.
  2. Advance programming skill is required to write program in OOP.
  3. Program execution can be slower as it needs conversion.

Natural Language (5GL)

As name suggests, natural language consist of instruction in the form of common language that we use for communication. Instead of writing complex syntactical structure of set of instruction we write statement which look like normal sentences. This language is still under development whereas some achievements has been unlocked too. Programming Language (PROLOG) is example of natural language which is in use. This language will be used solve futuristic problem such as AI, computer vision, robotics, machine learning etc.

Advantages of natural language

  1. It is easier to write program on natural language.
  2. Programmer doesn’t need to worry about syntactical error.
  3. Advance modern devices can have great functionality with natural language.

Disadvantages of natural language

  1. Natural language are still in development and has lots of flaws.
  2. Difficult to convert program written into natural language into machine understandable form.

Click here to learn C programming.