You are on page 1of 14

Types of Programming Language

Date: 05.09.2023
Properties of Algorithm
• It should terminate after a finite time.
• It should produce at least one output.
• It should take zero or more input.
• It should be deterministic means giving the same output for the same input case.
• Every step in the algorithm must be effective i.e. every step should do some work.
Characteristics of Algorithm
• Clear and Unambiguous/Definiteness: The algorithm should be
unambiguous. Each of its steps should be clear in all aspects and must lead
to only one meaning.
• Finite-ness: The algorithm must be finite, i.e. it should terminate after a
finite time.
• Feasible: The algorithm must be simple, generic, and practical, such that it
can be executed with the available resources.
• Language Independent: The Algorithm designed must be language-
independent, i.e. it must be just plain instructions that can be implemented
in any language, and yet the output will be the same, as expected.
Characteristics of Flowchart
• Easily understand the purpose of the program.
• Helps diagnose program errors.
• Assists in program writing.
• Assists in program modification and enhancement.
• It helps in writing complex programs easily and concisely.
Rules of Flowchart
1.Flowchart should contain conventional symbols.
2.Arrows should indicate flow from top to bottom or left to right.
3.When designing, the fewer the connection symbols, the better.
4.It should be easy to understand.
5.It should not be written in a specific programming language.
6.Multiple flow lines intersect but do not imply any logical relationship between them.
7.Designer must use separate flowchart for parts of one flowchart that requires detailed
description.
8.It should be drawn on one page as far as possible. If more than one page is required,
the previous page should be marked as used for the pre-determined process.
What is a programming Language?
• A programming language is an artificial language.
• Designed to communicate instructions to a machine, particularly a
computer.
• Programming languages are used to create programs that control the
behavior of a machine.

Program: A program is nothing but a list of instructions written in a


programming language that is used to control the behavior of a machine.
Types of Programming Language
• High level
Object-oriented High Level Language
Procedural

• Low level Low-Level Language

Machine Language
Assembly Language
The program written in high-level language is known as a source program and the
corresponding machine-level language program is called an object program.

High Level Language Low Level Language


Written in language which is easy to Written in codes or numbers which is
understand, code and debug difficult to understand, code or debug

Knowledge of hardware is not Requires knowledge of hardware


required

They are slower, and do not utilize They are faster as the program can
CPU or memory effectively directly control CPU and memory

e.g. C, C++, Java etc. e.g. MIPS, NASM etc.


Machine Language
• Machine language is the language that can directly run on the CPU.
• They are numeric, in series of bits which are 0s and 1s representing instructions
that a computer can understand.
• This makes it tedious and error-prone to write machine code manually.
• They are not portable, which means a language is specific to a particular type of
machine ultimately all languages need to be translated into machine language.
Assembly Language
• Assembly languages helped eliminate much of the error-prone and
time-consuming machine language programming. It replaces
remembering 1 and 0s with instructions which are mnemonic codes
for corresponding machine language.
• Example it has commands like MOV, JMP, CMP, ADD, etc.
• Each assembly language is specific to a particular computer
architecture and sometimes to an operating system. E.g. MIPS,
NASM, x86, etc.
Procedural Language and Object-Oriented Language

Procedural Language Object Oriented Language

It is top down approach It is bottom up approach


It is modelled as sequence of steps or It is modelled on real world as interaction
functions between objects.

Program is divided into functions Programs is divided into classes


Data is global so less secure Data is hidden so is more secure
It does not have features such as It provides features such as inheritance,
inheritance, polymorphism, etc. polymorphism

e.g. C, Basic, Fortran e.g. C++, Java, Python


Translator
Three types of translators are there:
Compiler
Compiler read the program at-a-time and searches the error and lists them. If the program is error
free then it is converted into object program. When the program size is large then the compiler is
preferred
Interpreter
Interpreter reads only one line of the source code and converts it to object code. It checks error,
statement by statement and hence take more time
Assembler
An assembler converts instructions written in assembly language to computer-readable machine
code. It can also compile or convert low-level assembly language code into machine language
code.
Compiler Interpreter
The program that translate the source The program that translate the source
program or source code to machine program or source code to machine
language or low-level language at once is language or low-level language step by
known as compiler. step or line by line is known as interpreter.

Faster execution of control statements as Slower execution of control statements as


compared to the interpreter. compared to the compiler.

Detected errors in the program get Detected errors in the program get
displayed after the entire program is read displayed after each instruction read by
by compiler. the interpreter.

Example: C++, Java. Example. Python, PHP.


source code object code

The set of instructions and statements The machine language program produced
written by computer programmer using a after the compilation of the source code is
programming language to find solution of known as object code or object module or
problem is known as source code or object program.
program

Human Readable Machine Readable


Created by the programmer Created by the Compiler

You might also like