473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

difference between object oriented programming and procedural programming

45 New Member
Hi All,
I am new to the software languages and wanted to learn C++. It seems that C++ is neither(complet ely) 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 9630
Cucumber
90 New Member
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 Recognized Expert Specialist
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 Recognized Expert Moderator Expert
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
3206
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. For example: As I understand it, OOP has its main benefit in software reuse. Thus one develops a software library of classes and this cuts down the overhead of reinventing the wheel. Someone might say that this can be done with structured...
4
1870
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
1655
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 more localized in C++ than C, which mean changes won't propogate far away in C++ code. By reusing through inherence and overloading, a lot of code can be saved. But I have to use C for some reason. Is there any programming paradigm in C, which...
4
1790
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 find it hard to put it into practice. In particular I am confused in terms of interacting with the database. It seems to me classes map quite closely to database tables and I end up with a bunch of methods in each class which simply call stored...
15
2472
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 objects that the app used to speed up some global level data access and functionality. I have recoded the class libraries in .net and would like to acomplish the same functionality in asp.net.
47
5965
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 site at http://ldeniau.web.cern.ch/ldeniau/html/oopc/oopc.html. The approach is very instructive. I know that I could do much of this stuff with e.g. C++, but the intellectual challenge of implementing these concepts with pure ANSI C is relevant to...
46
3036
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 language. When I read things like "... C++ is an evolution of C ..." or "... C is a subset of C++ ..." I tend to believe that I will have to learn C+ + sooner or later. It sounds like C++ is the future and C is the past (and will be no longer...
139
6003
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 guy thinking that C is a great programming language and that there is no need to program things object oriented. Many people says also that they save more time by programming projects object oriented, but I think its faster to program them in a...
3
1547
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 an instance of a class. that i know, i also know how to program with classes etc. i am just confused about the term object-oriented.
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.