+ 4
What is OOP?
what is object oriented programming? i just want to see some of your thoughts about this question. i know, one opinion is oop = classes + objects + inheritance, but what do you think? oop is a well known thing, but does even one of us clearly know what this means? can someone define this so everyone else can see "yes, that is an oop language and this is not"? so please leave some opinions and thoughts about what oop means or could mean.
10 Answers
+ 13
@ Gavin Christians awsome answer😊👌👌👌👍
+ 11
I also have same question. Thanks for asking this.
+ 11
great hard work here by .... @Gavin.....
i think @peter u should give him a best answer award here ....
+ 9
To understand OOP you need to understand what an object is and what a program is. An object is defined as something you can see and touch. A program is defined as a planned series of future events, items, or peformances.
OBJECT. This means that an object can be something real, or something virtual, meaning displayed on a computer.
PROGRAM. This means that a program can be something you can't physically see, or even virtually see. Meaning that a program can be something as simple as the process that works in the background that you don't see your computer is doing.
So now that we know what an object is and what a program is, we now know that in order for a program to be an OOP it has to meet these two conditions right? It has to be an object and it has to be a program right?
So let's apply this to real life using Java as the OOP we're trying to make an example of.
Consider the WORLD to be the environment (Windows, Mac, Android) for the program to run. In this world, YOU (a human) would then be an OOP, because you would meet the two conditions. You're an object and you're a program.
Example (Real life: Java):
class Human{
public static mouth(){
System.out.println("Talk");
}
public static eyes(){
System.out.println("See");
}
public static legs(){
System.out.println("Walk");
}
}
//You're considered a program because you have data and functionality
//You're considered a OOP because your data and functionality creates YOU in the WORLD
//So using this logic, the WIND wouldn't be an OOP because you can't see it but you know that it's there, it's a background process
+ 6
with Biraj Patel
+ 3
I see where you might get confused with C because you can do ✌object oriented-like✌ programming but it's not an object oriented programming language. That's why C++ exist, for an object oriented programming language. C++ is a subset of C.
C is not designed with facilities specifically to support object oriented programming.
+ 2
OOP is when you make "model" - in this case object and function, so you can call same code later with different parameters easily, without rewriting it.
+ 2
@gavin christians nice answer but i have a question to this. would you agree if i would say C is an oop language? in c i have some things like classes (called structs, but behave nearly the same as java classes) i can instantiate them to get objects an i can make some functions. the functions aren't defined inside a struct, but Echo cares. i think everybody would disagree to c being object oriented, but from the right point of view it could be. i wanted to start this question as a starting point for a discussion, and less getting my question answered. im just interested in different opinions, because many people use the words oop, but i think noone really knows what this means. there are many definitions, but you really cant make a clear definition what is an oop language and what isnt. just compare java c c++ JavaScript html and xml for example. in all of them you can find some object like things, but not all could be called object orientated. just think a bit about this. thanks for reading this.
+ 1
There's more than one difference @Peter but I'll name only one, one that's important to me. Exceptions.
0
now this becomes a discussion. i hope not only between us 2, everyone else is invited to state his or her opinion, too. next question: i have programmed in both c and c++, so i know these languages. what makes THAT ONE difference why c++ is object oriented and c is not? the keywords class and new? i hope keywords aren't the reason. member methods are inside a class instead of being directly next to the struct, but outside of it? well that's only a question of design but hey who cares where functions are located. you got modifiers private public and so on? im actually not sure if they aren't in c, but you don't need to use them. you make restrictions for the programmer, the program does not need them. see what i mean? i think oo is more a programmers thing, you can program in (nearly) every language oo like, but you aren't able, at least in my opinion, to differ exactly between whats an oop language and what is not. thanks for this discussion it is very interesting to see others minds and thoughts on this.