INTRODUCTION TO PROGRAMMING LANGAUGES
Computer converts one form of the data into another form under control of a program. A
program is a set of instructions. We know that a computer can understand two things zero and
one. If we give instructions to the computer using only zeros and ones it is called as binary
language or machine language.
Machine Language:
Machine language consists of zeroes and ones
Advantages:
Fast execution because computer can directly understand those instructions
Disadvantages:
1) Very hard to learn and implement
2) Machine dependent
3) Debugging is very difficult
Assembly Language:
Assembly language consists of symbolic operational codes like MOV, ADD, LOAD etc.
Advantage:
Compared to machine language it is easy to learn and implement.
Disadvantages:
1) Conversion is required . Assembler is used to convert Assembly language program into
machine language.
2) Machine dependent because in Assembly Language instructions we use registers and other
machine related things in our program if we use any architecture related things then that
program becomes Machine dependent.
3) must have strong knowledge in machine architecture.
Highlevel Languages:
High Level Languages consist of simple English words and verbs.to convert high level language
into machine language compilers and interpreters are used.
In the beginning for each specific purpose one programming language was developed ,for
scientific applications FORTRAN, business application COBOL like. People started thinking
instead of developing each purpose a separate language why should not we develop one
language which can serve all the purposes. Then C language was developed. C language is called
as a procedure oriented programming language. Main task is divided into number of sub tasks.
If required again these subtasks are divided into sub sub tasks and so on. Once solutions for
each subtask are found then we integrate those solutions to do the main task.
There are some problems with procedure oriented programming languages.
The first problem is data security problem. In C language if two or more functions need the
same data item, then that data item must be declared as global, but if a data item is declared as
global not only those two functions any function can access the data. If one function changes
the data, then it is reflected to all other functions. there is no security for the data. In procedure
oriented programming languages concentration is on what is being happing but never
concentrate on who is going to be effected.
Procedure oriented programming languages use static loading mechanism.
In order to execute a program, it must be brought into the main memory. At any point of time
we may execute only some part of the program but still the total executable file must be
present in the main memory. This is called as static loading. If the file is too large then there is
complexity problem and performance is also getting down
For example, we have developed a project on library management system with some modules.
First we write the code and we compile and then build the exe file that exe file is executed to
run the project. Suppose the exe file consists of 10000 lines of code. At any point of time we
may make use of only one module but the total code is residing in the main memory.
To overcome the problems in procedure oriented programming languages object oriented
programming languages were developed. Every problem we solve by means of objects we think
the solution in terms of objects. So these are called object oriented programming languages.
Objects are basic building blocks of object oriented programming languages.
Differences between OOP and POP:
Object-oriented Programming Procedural Programming
1) In Object oriented programming 1) In Procedural programming
problems are solved by means of main task is divided into number of
objects. Objects are the basic building subtasks; again these subtasks are
blocks of object oriented divided into number of sub sub tasks
programming .we think solution in so forth. Once each subtask has been
terms of objects performed then integrate all the
subtasks to do the main task
2) It follows bottom up approach 2). It follows top down approach
3) It makes development and 3). In procedural programming it is not
maintenance easier very easy to maintain the codes when
project becomes lengthy
4) It provides a mechanism to bind the 4).procedural language does not provide
data and its associated methods data binding so it is less secure
together in a single unit so it is more
secure
5) Example : java , python 5). Example : Pascal, C