473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

difference between object oriented programming and procedural programming

Hi All,
I am new to the software languages and wanted to learn C++. It seems that C++ is neither(completely) an object oriented programming nor(completely) a proceduarl programming. So, I was wonderinmg what is the diffrence between object oriented and procedural programming. Can anyone of you, please, let me know the difference as soon as possible.

Thanks and regrads,

KiranJyothi
Sep 30 '07 #1
3 9611
Procedural programming means breaking your program into functions; where each function performs an specific task. You pass data back and forth to these functions, each function processes the data just a bit. Hence functions are the basis of the code and data plays a secondary role.
So this might be called "Functions Oriented" programming, or if you will, "Procedure based" programming AKA Procedural Programming.

With Object Oriented Programming, the data has bound functions (known as "methods") that process the data they are bound to. So you no longer pass data back and forth between functions, you just call the functions that are bound to data (albeit you still may pass parameters as extra information for these functions to perform more specific tasks).
You might call this "Data Oriented Programming", but in OOP, the data that has bound functions is known as Object, so it is called "Object Oriented Programming".

By the way, with a little bit of effort you can do OOP in raw C language.
Sep 30 '07 #2
Ganon11
3,652 Expert 2GB
I've always felt that procedural programming was putting everything inside the main() function...I guess you learn something every day.
Sep 30 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
Not quite correct:
With Object Oriented Programming, the data has bound functions (known as "methods") that process the data they are bound to. So you no longer pass data back and forth between functions, you just call the functions that are bound to data (albeit you still may pass parameters as extra information for these functions to perform more specific tasks).
You might call this "Data Oriented Programming", but in OOP, the data that has bound functions is known as Object, so it is called "Object Oriented Programming".
The above is true for all object programming. Unfortumately, there are two kinds of object programming: a) object-based and b) object-oriented.

In object-based programs, objects are created and their methods are executed as needed. That is, you create the object and you tell the object what to do.

In object-oriented programs, objects are described within a hierarchy where the top level is a general object and each suceeding level contains specific kinds of that general object. What you do here is create a specific object but use it as the general object when you make a function call. The function believes it has a general object but when the object is asked to excute a method, it is the method in the specific object that executes. In this manner, the same line of code referencing a general object can do many things based on the particular specific object in use at the time.

This substitution of a specific object for a general object is called polymorphism. Using polymorphism is commonly called object-oriented programming.
Oct 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

34
by: Pmb | last post by:
Hi. I'm new to this group. I'm refreshing/learning C++ and am starting to learn Object Oriented Programming (OOP). In discussing this with people I came up short as to what the benefits of OOP are....
4
by: mihai | last post by:
I wander what is the penalty of speend for using object oriented programming (C++) against the play C. Have a nice day, Mihai
14
by: PengYu.UT | last post by:
Hi, I have been using C++ a lot and I've almost forgot what syntax is support by C and what syntax is support by C++? My feeling is that C++ gives programmer much flexibility. And the code is...
4
by: scottrm | last post by:
I am fairly new to oo design and I am looking at developing an object oriented asp.net application which will be built on top of a relational database. I have read quite a bit of the theory but...
15
by: randyr | last post by:
I am developing an asp.net app based on a previous asp application. in the asp applications global.asa file I had several <object id="id" runat="server" scope="scope" class="comclass"> tags for...
47
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web...
46
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented...
139
by: Joe Mayo | last post by:
I think I become more and more alone... Everybody tells me that C++ is better, because once a project becomes very large, I should be happy that it has been written in C++ and not C. I'm the only...
3
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.