Difference between Procedural, Structured, and Object-Oriented Programming

By: Jagan Emailed: 1768 times Printed: 2515 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Until recently, programs were thought of as a series of procedures that acted upon data. A procedure, or function, is a set of specific instructions executed one after the other. The data was quite separate from the procedures, and the trick in programming was to keep track of which functions called which other functions, and what data was changed. To make sense of this potentially confusing situation, structured programming was created.

The principle idea behind structured programming is as simple as the idea of divide and conquer. A computer program can be thought of as consisting of a set of tasks. Any task that is too complex to be described simply would be broken down into a set of smaller component tasks, until the tasks were sufficiently small and self-contained enough that they were easily understood.

As an example, computing the average salary of every employee of a company is a rather complex task. You can, however, break it down into these subtasks:

1. Find out what each person earns.

2. Count how many people you have.

3. Total all the salaries.

4. Divide the total by the number of people you have.

Totaling the salaries can be broken down into

1. Get each employee's record.

Access the salary.

Add the salary to the running total.

Get the next employee's record.

In turn, obtaining each employee's record can be broken down into

1. Open the file of employees.

Go to the correct record.

Read the data from disk.

Structured programming remains an enormously successful approach for dealing with complex problems. By the late 1980s, however, some of the deficiencies of structured programing had became all too clear.

First, it is natural to think of your data (employee records, for example) and what you can do with your data (sort, edit, and so on) as related ideas.

Second, programmers found themselves constantly reinventing new solutions to old problems. This is often called "reinventing the wheel," and is the opposite of reusability. The idea behind reusability is to build components that have known properties, and then to be able to plug them into your program as you need them. This is modeled after the hardware world--when an engineer needs a new transistor, she doesn't usually invent one, she goes to the big bin of transistors and finds one that works the way she needs it to, or perhaps modifies it. There was no similar option for a software engineer.

New Term: The way we are now using computers--with menus and buttons and windows--fosters a more interactive, event-driven approach to computer programming. Event-driven means that an event happens--the user presses a button or chooses from a menu--and the program must respond. Programs are becoming increasingly interactive, and it has became important to design for that kind of functionality.

Old-fashioned programs forced the user to proceed step-by-step through a series of screens. Modern event-driven programs present all the choices at once and respond to the user's actions.

Object-oriented programming attempts to respond to these needs, providing techniques for managing enormous complexity, achieving reuse of software components, and coupling data with the tasks that manipulate that data.

The essence of object-oriented programming is to treat data and the procedures that act upon the data as a single "object"--a self-contained entity with an identity and certain characteristics of its own.

C++ Home | All C++ Tutorials | Latest C++ Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.

Bookmark and Share


1. View Comment

I find dis site very educating

View Tutorial          By: Kensho at 2009-05-09 05:18:57
2. View Comment

it is good site , and i have cleared my doubts

View Tutorial          By: imtiaz at 2009-10-15 23:43:50
3. View Comment

really helpfull and gets all the stuff what u want

View Tutorial          By: yash at 2009-10-25 12:28:57
4. View Comment

Great Description. Helped a lot.

View Tutorial          By: Dee2019nc at 2009-11-08 18:26:22
5. View Comment

this site is really very useful.
it provides good knowledge to us
this describes easy language.

View Tutorial          By: ankush bansal at 2009-11-12 08:34:13
6. View Comment

great material for language bugs....

View Tutorial          By: manoj kapri at 2009-11-30 00:30:13
7. View Comment

Thanks a ton sir.....
This is very informative..

View Tutorial          By: Shailaja at 2009-12-27 10:43:42
8. View Comment

Its a peshak site

View Tutorial          By: SANIJ at 2010-01-06 22:40:31
9. View Comment

plz show me my answers

View Tutorial          By: Debnita Saha at 2010-05-01 05:15:16
10. View Comment

i have been searching for this result for more than a year.usually i get the result as found in books that i was not able to unterstand best way explain opps concept .not like the way in books containing terms like object ,data ,function etc.

View Tutorial          By: nithin at 2010-08-08 12:55:18
11. View Comment

This is very clear and explains the concepts in a simple and understandabe way - thank you

View Tutorial          By: Reite at 2011-02-18 13:55:07
12. View Comment

Such a nice site for clear and explains the concepts of Java Language

View Tutorial          By: Sandeep at 2011-05-22 06:34:42
13. View Comment

It may be good ,when you stressed on the point why we need OOP, when we have Structured Programming Language.

View Tutorial          By: Kishore Mylavarapu at 2011-05-25 01:28:50
14. View Comment

Is site ki badolat main C++ mein paas ho gya !

View Tutorial          By: sharif at 2011-08-06 10:06:31
15. View Comment

this is really very useful because of this site i know oops very clearly.thank u :)

View Tutorial          By: meenakshi shukla at 2012-09-15 05:09:49
16. View Comment

Awesome article. It's very useful. Despite it didn't explained if is there any difference from the Structured x Procedural. Are they the same? thanks.

View Tutorial          By: Matheus at 2015-02-24 12:06:05
17. View Comment

great material for language

View Tutorial          By: hafiz at 2015-03-24 12:18:45

Your name (required):

Your email(required, will not be shown to the public):

Your sites URL (optional):

Your comments:

More Tutorials by Jagan
Importing a Certificate for the CA example using keytool in Java
The if-then-else Statement in Java
WHERE Clauses in SQL
The TryCatchFinally Interface in JSP
assert() Function Example program in C
Guidelines for Struts Application Development
Using printf function in C
File Inclusion in C
Using Multiple Message Resource Bundles in Struts
While and For Loops in C
Arrays sample program in C
Controlling Page Navigation in JSF - Static and Dynamic Navigation
Using cout.fill() in C++
Types of Profiles in J2ME
DateField sample program in J2ME

More Tutorials in C++
Two-Dimensional Array Manipulation in C++
Calculate average using Two-Dimensional Array in C++
Compute the square root of the sum of the squares of an array in C++
Matrix using nested for loops in C++
Sorting an array of Strings in C++
Calculating total based on the given quantity and price in C++
Compiling and Linking Multiple Source Files in C++
Enumerations in C++
Program to add two numbers in C++
Comments in C++
while loop in C++
for loop in C++
Programming errors a compiler will detect in C++
if in C++
Using the Built-in Arithmetic Types in C++

More Latest News
Most Viewed Articles (in C++ )
Calculating total based on the given quantity and price in C++
while (1) Loops in C++
Constructors and Destructors in C++
Difference between Procedural, Structured, and Object-Oriented Programming
C++ and Object-Oriented Programming
Getting Started with C++
Using Comments in a C++ Program
assert() example program in C++
Implementing Pure Virtual Functions in C++
Pass by Reference in C++ functions
Two-Dimensional Array Manipulation in C++
A Brief History of C++
const Member Functions in C++
C++ Sample Program for Allocating, using, and deleting pointers.
Converting C++ Multiple-Inheritance Hierarchies to Java
Most Emailed Articles (in C++)
C++ and Object-Oriented Programming
Using cout in C++
Demonstrating global and local variables in C++
const Member Functions in C++
Classes with Other Classes as Member Data in C++
What Is a Pointer in C++?
Manipulating Data by Using Pointers
Stray or Dangling Pointers in C++
strcat() and strncat() sample program in C++
Using #define, The Preprocessor and the Compiler in C++
Getting User Input Using cin in C++
Pass by Reference in C++ functions
Vector variables in C++
Multi-Line Literals in C++
Lvalues and Rvalues in C++