473,883 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When not to use Object Oriented Programming?

Curtis Rutland
3,256 Recognized Expert Specialist
I was reading through some job postings on a game developer's web site (without any real interest of applying). One of the ones that I saw had this bullet point in the requirements:
  • Appreciation of when not to use Object Oriented Programming.
I've done almost all my work in OO languages...so can someone enlighten me? When do you not want to use OOP?
Dec 23 '08 #1
41 18867
JosAH
11,448 Recognized Expert MVP
@insertAlias
Object oriented programming isn't the one and only 'truth' (mind the quotes). There are quite a lot of problems that are easier, and more naturally, expressed by using a functional programming language or a logic programming language. Don't get stuck in one single paradagm; you'll think that the whole world is OO; it isn't. On top of that: most people program OO-ish, not pure OO (see C++ or Java for examples); and please don't ask me for a strong definition of 'pure OO' ;-)

kind regards,

Jos
Dec 23 '08 #2
NeoPa
32,584 Recognized Expert Moderator MVP
Maybe they're after someone coming in to say confidently that they don't see any scenario where OOP is less appropriate than procedural programming.

I was thinking of specific interrupt handling - but if anything, that is quite similar to OOP in its design. It's more of a stretch for those with procedural training (so much so that I found myself quite unable to convince an otherwise intelligent programmer of why his code wasn't able to work reliably within the interrupt space).
Dec 23 '08 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
This all depends upon what you call OOP.

In C++ all execution occurs within a function. It doesn't matter whether you pass the address of the object as an argument (regular function) or whether the compiler does it (member function) so you can't say that OOP is using member functions. In this context C is object-oriented.

Maybe you say OOP is substituting one object for another (using polymorphism). However, you can't do this in C++ since C++ does not support the Liskow Substitution Principle. As implemented, C++ permits substituting only the address of the object but not the actual object itself. In this context C++ does not support OOP.

etc...
Dec 23 '08 #4
JosAH
11,448 Recognized Expert MVP
@NeoPa
I don't understand that; care to elaborate? Please write slowly, I'm a slow understander ;-)

kind regards,

Jos
Dec 23 '08 #5
NeoPa
32,584 Recognized Expert Moderator MVP
Procedural programming typically expects the flow to be sequential. Essentially one stream of logic.

OOP doesn't seem to require it work this way so much. It expects that triggers may arrive from all different sources.

Similarly, interrupt processing requires an understanding of the code not necessarily flowing from top to bottom in such a simple fashion.

Does that make sense?
Dec 23 '08 #6
JosAH
11,448 Recognized Expert MVP
@NeoPa
Yes it does but your mixing up event driven programming with just OOP; OOP doesn't say anything about asynchronous events or the like. OOP can be as procedural as can be.

kind regards,

Jos
Dec 23 '08 #7
Curtis Rutland
3,256 Recognized Expert Specialist
I think you're mixing event-driven programming with OOP. OOP can be procedural, and I think that non-OO langs can be event-driven.

EDIT: LOL, great minds think alike, Jos...
Dec 23 '08 #8
NeoPa
32,584 Recognized Expert Moderator MVP
@insertAlias
Very possibly. I stopped progressing when OOP came along. I've picked up a little of the concepts here and there but make no claims to a proper understanding of the principles.
Dec 23 '08 #9
JosAH
11,448 Recognized Expert MVP
@NeoPa
No problem; OOP is basically about structuring not only code (procedural programming) but also the data on which the code acts. We create 'things' or 'objects' with that and add a whole lot of hulla baloo on top of it (inheritance, polymorphism, data hiding and what have you). The topping is mainly because humans tend to make a mess out of every discipline. The programming part (normally the procedural part) can be anything: functional, logic or even just assembly code.

kind regards,

Jos
Dec 23 '08 #10

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

Similar topics

34
3218
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...
14
2945
by: Rookie | last post by:
Is C an object oriented programming language?
8
2391
by: Dale | last post by:
I've searched Amazon and read probably 100 reviews but can't find what seems to be any book that is widely accepted as the definitive book on object oriented programming design and techniques. And most of the highest rated are all written 10 to 15 years ago. Any good suggestions?
3
1419
by: David Lozzi | last post by:
Howdy, I've discovered how to create and use a class in ASP.NET. However, when is the best time to use a class? For example, I am currently using session variables to store user information (user id, user name, full name, security level, department, etc.). Would I do better to create a class instead? Also, if I did, would I simply store the ID in the session and when accessing the class (User.FullName, User.SecurityLevel, etc.) then check the...
22
2345
by: Mike Polinske | last post by:
I am new to the C programming language but have been programming in Cobol for over 10 years. When I compile the following code, it compiles clean but I get an application error both under Windows XP and Win2K. #include <stdio.h> #include <ctype.h> char title = "Year End Report";
47
5978
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
3047
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
6035
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
1551
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
9791
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11137
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
10410
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...
1
7970
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
7122
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5797
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...
1
4609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4215
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3231
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.