Table of Contents
Types Of Programming Language
Types of programming language: A computer is a computational device which is used to process the data under the control of a computer program.
The operations of a computer are controlled by a set of instructions called a computer program. These instructions are written to tell the computer:
What Operation to Perform?
Where to locate data?
How to present results?
When to make certain decisions?
The communication between two parties, whether they are machines or human being, always needs a common language or terminology.
The language used in the communication of computer instructions is known as the programming language.
Computers understand only one language and that is a binary language or the language of 0’s and 1’s. Binary language is also known as machine language.
There are two types of programming language, which can be categorized into the following ways:
Low-Level Language ( Types of Programming Language)
Low-Level Language, are languages close to the machine level instruction set. They provide less or no abstraction from the hardware.
A low-level programming language interacts directly with the registers and memory. Since instructions written low-level languages are machine-dependent.
Programs developed using low-level languages are machine-dependent and are not portable.
Programs execution in low-level languages is very fast.
Low-level languages are hardware-dependent languages we cannot reuse code on different hardware devices.
Low-level languages are further classified in two or more categories namely machine language and assembly language.
1. Machine Language:
The set of instruction codes, whether in binary or decimal, which can be directly understood by the CPU of a computer without the help of translating program, is called a Machine Language.
Thus, machine language programs need to be coded as strings of binary digits i.e 0’s and 1’s.
Typically operations involve reading, adding, subtracting, writing and so on. For example, typically program instruction to printout a number on the printer might be, 0 0 1 1 0 0 1 0 1 0 1 0.
Machine language is usually used for complex applications such as space control system, nuclear reactors, and chemical processing.
Advantages of Machine Language:
Translation Free: Machine Language is written in 0’s and 1’s so, CPU directly understands machine instructions and no translation of the program is required.
High Speed: Since no translation is needed, the applications developed using machine language is extremely fast.
Disadvantages of Machine Language:
Machine-dependent: Machine language differs from computer to computer. Hence, the program written for one machine cannot be executed on other machines.
Difficult to write or Program: Writing a program in machine language is very tedious because it is difficult to learn and understand the language, which is in strings of 0’s and 1’s.
Difficult to Locate Error: Checking machine instructions to locate errors is very difficult and time-consuming.
2. Assembly Language:
As the computer became popular, it became quite apparent that machine language programming was simply too slow, tedious for most programmers. Types of Programming language.
The language which substitutes letters and symbols for the numbers in the machine language program is called as Assembly language or Symbolic Language.
A Program written in symbolic language that uses symbols instead of numbers is called as Assembly code or symbolic code i.e MNEMONICS.
The computer instructions are written in easily understandable short words which are called MNEMONICS. For example, MOV stands for moving the data, SUB stands for subtraction, ADD stands for addition, etc. All instructions are written in capital letters.
A program in Assembly language needs software known as an assembler which converts the program consisting of mnemonics and data into machine language.
Advantages of Assembly Language:
Faster: Assembly level language programs can run much faster and use less memory and other resources than a similar program written in a high-level language.
Easier to Understand and Use: Assembly language is easier to understand and use because mnemonic is used instead of numeric op-codes and suitable names are used for data.
Easy to Locate and Correct Errors: While writing programs in assembly language, programmers can easily track and locate errors.
Easier to Modify: Assembly language programs are easier for people or user to modify than machine language programs.
Disadvantages of Assembly Language:
Slow Development Time: Assembly level language applications are slower and time-consuming to develop.
Machine Dependent: Assembly language programs are machine-dependent i.e., assembly language differs from computer to computer.
Knowledge of Hardware Required: Since assembly languages are machine-dependent. so the programmer must be aware of a particular machine’s characteristics and requirements as the program are written.
Machine Level Coding: A machine cannot execute an assembly language program directly. It needs to be first translated into a machine language code. This is done by an assembler.
High-Level Language (Types of Programming Language)
During 1960s computers started to gain popularity and it became necessary to develop languages that were more like natural languages such as English so that a common user could use the computer efficiently.
High-Level Languages (HLL) provides a higher level of abstraction from machine language. High-level languages are written using a set of words and symbols following some rules similar to a natural language such as English.
The High-level languages are similar to the English language and is one of the types of programming language. Programs written using these languages can be machine-independent.
A single high-level statement can substitute several instructions in the machine or assembly language. In a high-level language, programs are written in a sequence of statements to solve a problem. For example: sum = x + y.
Languages such as COBOL, FORTRAN, BASIC, and C are considered high level languages. Instructions of high level language closely resembles to human language or English like words. It uses mathematical notations to perform the task.
High-level language can be further categorized as follows:
1. Procedural-Oriented Language:
Procedural programming is a methodology or types of programming language used for modelling the problem being solved. by determining the steps and the order of those steps that must be followed in order to reach the desired outcome or specific program state.
These languages are designed to express the logic and the procedure of a problem to be solved.
Because of their flexibility, procedural languages are able to solve a variety of problems. It includes languages such as Pascal, BASIC, COBOL, C, FORTRAN, etc.
2. Problem-Oriented Language:
It allows the users to specify what the output should be, without describing all the details of how the data should be manipulated to produce the result. These are result oriented and include database query language.
Examples include Visual Basic, C#, PHP, java etc.
3. Natural Language:
Natural language is still in developing stage where we could write statements that would look like normal sentences.
The programs designed using natural languages will have Artificial Intelligence (AI).
Examples include Prolog.
Advantages of HLL:
Machine Independent: High-Level Language (HLL) is machine-independent in the sense that a program created using HLL can be used on different platforms with very little or no change at all.
Fewer Errors: In case of HLLs, since the programmer need not write all the small steps carried out by the computer, for this reason, the computer is much less likely to make an error.
Easier to Maintain: Program written in high-level languages are easier to maintain than assembly or machine language programs.
Easy to Learn and Use: These languages are very similar to the languages ms in HLLs requires less time day-to-day life. Hence, they are easy to learn and use.
Lower Program Preparation Development Cost: Writing programs in HLL requires less time and effort, which ultimately leads to lower program preparation cost.
Disadvantages of HLL:
Lack of Flexibility: Because the automatic features of high-level languages always occur and are not under the control of the programmer, they are less flexible than assembly languages.
Lower Efficiency: The programs written in high-level languages take more time to run and require more main storage.
Poor Control on Hardware: Sometimes, the applications written in high-level languages cannot completely harness the total power available at the hardware level
Differentiate Between Machine, Assembly and High-Level Languages:
1. Machine Language:
It is in the form of 0’s and 1’s.
Machine Dependent Language.
It does not need any language translators like assembler or compiler.
It is difficult to programming.
Speed is high.
Hard and difficult to understand.
Not user friendly.
Assembly Language:
It is in the form of symbolic phrases called MNEMONIC like ADD, MOV etc.
Machine dependent language.
A translator ‘assembler’ is required to convert assembly language into machine code.
It is difficult to programming.
Speed is high.
Hard and difficult to understand.
Not user friendly.
High Level Language:
It is in the form of English words.
Machine independent Language.
A translator like ‘compiler or interpreter’ is required to translate high-level language into machine level languages.
Easy to programming.
Speed is slow.
Easy and simple to understand.
User friendly.