Originally Posted by wikipediaHow do you create an object in C++ without a class?Originally Posted by vart
Originally Posted by wikipediaHow do you create an object in C++ without a class?Originally Posted by vart
How do you use OOP without C++?Originally Posted by 7stud
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Depending on whether you see structs as different from classes, you can't (with any sane amount of work - actually you can with some brutal hackery). But that's not the point. OOP is independent of C++. Just because classes are the only proper way to get OOP in C++, doesn't mean that OOP generally depends on classes. JavaScript's prototype system is also object-oriented, but JS doesn't have classes (yet).Originally Posted by 7stud
Definitions I like are from James O. Coplien's book "Multi-Paradigm Design for C++". He distinguishes between object-based programming and object-oriented programming.
In C++, object-based programs are programs which use simple classes and objects instantiated from them, like std::string, std::complex and similar utilities. (The fact that they're templates aside.)
To be object-oriented, a program needs to use inheritance and polymorphism.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Wow, this debate will go down well on the GD board. I think everybody is correct. Classes and OOP form a partnership. Look at C#. It is more or less pure OOP.
Double Helix STL
Question?
Is one idea with classes to incorperate modular programming instead of being dependant on only modular programming?
also i'm probably jumping the gun but is inheritence classes sharing members?
Last edited by wart101; 01-10-2007 at 04:24 PM.
WhAtHA hell Is GoInG ON
Yo any answers? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WhAtHA hell Is GoInG ON
> Is one idea with classes to incorporate modular programming instead of being dependent on only modular programming?
I have no idea what you are asking here.
> also i'm probably jumping the gun but is inheritance classes sharing members?
Define sharing.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Using classes gives you objects, it depends on how you implement these objects that make the program object oriented not just object containing. For instance if a program had one class and one instance of the class and used each method only once, I would consider that procedural, not object oriented.
Yes, along with not being able to understand answers to your questions, you don't have enough knowledge about OOP and classes to even ask meaningful questions. Nothing wrong with that. I know that I can't ask meaningful questions about large swaths of C++.Yo any answers?
At this point in your education, there is no need to waste time on such issues. Learn the mechanics. Things will become clearer. But the programming techniques spawned by OOP are vast, and you can spend a lifetime probing their mysteries.
Last edited by 7stud; 01-10-2007 at 06:30 PM.
Look sorry if my question are based on a ignorance but i have to ask anyway, i understand that there is no need to know about the things that i might be asking but i feel as though i have to, if what i am saying makes no sence all i ask for i honesty and i thank you for giving it to me.
the basis for my question is from something i read
now i took that with an answer from this guyIn computer science, a module is a software entity that groups a set of (typically cohesive) subprograms and data structures.
as well as thisOriginally Posted by vart
and i asked the question, is one idea to use modularity in your classes?Object-oriented programming (OOP) is a programming paradigm that uses abstraction to create models based on the real world. It utilizes several techniques from previously established paradigms, including inheritance, modularity, polymorphism, and encapsulation
perhaps my question should have been more defined,
IN MY QUEST TO UNDERSTAND OOP SHOULD I BE USING MODULES IN MY CLASSES?
Last edited by wart101; 01-10-2007 at 09:18 PM.
WhAtHA hell Is GoInG ON
if you don't mind how long have you guys been programming for?
WhAtHA hell Is GoInG ON
Yo answers?
WhAtHA hell Is GoInG ON
How about being patient? You only waited half an hour.
Yea patience is a thing of requirement on boards. One, people here have to work, two they mightnot be on their comps, or maybe even three they are not in the mood for answering questions. Just be patient your answers will come. As for me I have been programming for almost 2 years. Also, in most situations ( as I have found ) use OOP if and only if it is needed or necessary. Something like a basic media player, or a text based game generally wont need it. Yet if you are going to be making a large scale full blown media player ( similar to WMP ) then yea it is necessary for easy maintenance. Changing one function or variable, or adding those is much easier in a class because you dont have to hunt through 1000's of lines of code. you just change it in your class, and Tada it changed. That may seem a little unclear but think about it for a second, and it should become clear. Although I am one of the more inexperienced people on the boards so may not be smart to take my advice without asking a pro first.
this is not necessarily true. As was said in this thread too, more and more programmers get convinced that OO actually is *not* the way to go and that it's easier to maintain procedural programs. It certainly is the solution to everythingOriginally Posted by g4j31a5