Using the procedure programming approach; you view a problem as a sequence of things to do such as a reading, calculating and printing. Conventional programming using high level language is commonly known as procedural programming.
Procedural oriented programming basically consists of writing a list of instruction for the computer to following and organizes this instruction into groups known as functions. While we concentrate on the development of function, very little attention is give to the data that are being used by various functions.
In a multi-function program, many important data items are placed as global so that they may be accessed by all functions. Each function may have its own local data. Global data are more vulnerable to an inadvertent change by function. In a large application it is very difficult to identify what data is used by which function. In that case we need to revise an external data structure. We should also need to revise all functions that access the data. This provides an opportunity for bugs to creep in.
Basic feature of Procedural Programming
The basic feature of Procedural-oriented Programming is to reuse the same code at different places in the program without coping it.
- Emphasis is on doing things (algorithms).
- Large programs are divided into smaller programs known as functions.
- Most of the functions share global data.
- Data move openly around the system from function to function.
Object Oriented Programming
Before going any further into OOP, take note of two points. First, OOP is only a method of designing and implementing software. Use of OOP techniques does not impart anything to a finished software product that the user can see. You can take advantage of the modularity of objects and implement the program in relatively independent units that are easier to maintain and extend. You can also share code among objects through inheritance.
Basic feature of Object Oriented Programming
Object-orientation contributes to the solution of many problems associated with the development and quality of software products. The technology provides greater programmer productivity, better quality of software and lesser maintenance cost. The principle advantages are:
- Through inheritance, we can eliminate redundant code and extend the use of existing classes.
- We can build programs from the standard working modules that communicate with one another, rather than having to start writing the code from scratch. This leads to saving of development time and higher productivity.
- The principle of data hiding help the programmer to build secure programs that cannot be invaded by code in other parts of the program.
- It is easy partition the work in a project based on objects.
- Object oriented systems can be easily upgraded from small to large systems.
- Software complexity can be easily managed.
- It is possible to map objects in the problem domain to those objects in the program.
- It is possible to have multiple instances of an object to co-exist without any interference.
- The data-centered design approach enables us to capture more details of a model in implementable form.
While it is possible to incorporate all these features in an object-oriented system, their importance depends on the type of the project and the preference of the programmer. There are a number of issues that need to be tackled to reap some of the benefits stated above. For instance, object libraries must be available for reuse. The technology is still developing and current products may be superseded quickly. Strict controls and protocols need to be developed if reuse is not to be compromised.