<p>Since debate without meaningful terms is <a href="https://stackoverflow.com/questions/24270/whats-the-point-of-oop">meaningless</a>, I figured I would point at the elephant in the room and ask: What exactly makes a language "object-oriented"? I'm not looking for a textbook answer here, but one based on your experiences with OO languages that work well in your domain, whatever it may be.</p>

<p>A related question that might help to answer first is: What is the archetype of object-oriented languages and why?</p>

[{'answer_id': 29106, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Supports classes, methods, attributes, encapsulation, data hiding, inheritance, polymorphism, abstraction...?</p>\n'}, {'answer_id': 29121, 'author': 'Vaibhav', 'author_id': 380, 'author_profile': 'https://Stackoverflow.com/users/380', 'pm_score': 3, 'selected': False, 'text': '<p>According to Booch, the following elements:\nMajor:</p>\n\n<ul>\n<li>Abstraction</li>\n<li>Encapsulation</li>\n<li>Modularity</li>\n<li>Hierarchy (Inheritance)</li>\n</ul>\n\n<p>Minor:</p>\n\n<ul>\n<li>Typing</li>\n<li>Concurrency</li>\n<li>Persistence</li>\n</ul>\n'}, {'answer_id': 29128, 'author': 'Kristopher Johnson', 'author_id': 1175, 'author_profile': 'https://Stackoverflow.com/users/1175', 'pm_score': 2, 'selected': False, 'text': '<p>Smalltalk is usually considered the archetypal OO language, although Simula is often cited as the first OO language.</p>\n\n<p>Current OO languages can be loosely categorized by which language they borrow the most concepts from:</p>\n\n<ul>\n<li>Smalltalk-like: Ruby, Objective-C</li>\n<li>Simula-like: C++, Object Pascal, Java, C#</li>\n</ul>\n'}, {'answer_id': 29217, 'author': 'Quibblesome', 'author_id': 1143, 'author_profile': 'https://Stackoverflow.com/users/1143', 'pm_score': -1, 'selected': False, 'text': "<p><strong>Archetype</strong></p>\n\n<p>The ability to express real-world scenarios in code.</p>\n\n<pre><code>foreach(House house in location.Houses)\n{\n foreach(Deliverable mail in new Mailbag(new Deliverable[]\n              {\n              GetLetters(), \n              GetPackages(), \n              GetAdvertisingJunk()\n              })\n {\n    if(mail.AddressedTo(house))\n    {\n        house.Deliver(mail);\n    }\n }\n}\n</code></pre>\n\n<p>-</p>\n\n<pre><code>foreach(Deliverable myMail in GetMail())\n{\n    IReadable readable = myMail as IReadable;\n    if ( readable != null )\n    {\n        Console.WriteLine(readable.Text);\n    }\n}\n</code></pre>\n\n<p><strong>Why?</strong></p>\n\n<p>To help us understand this more easily. It makes better sense in our heads and if implemented correctly makes the code more efficient, re-usable and reduces repetition.</p>\n\n<p>To achieve this you need:</p>\n\n<ul>\n<li><strong>Pointers/References</strong> to ensure that this == this and this != that.</li>\n<li><strong>Classes</strong> to point to (e.g. Arm) that store data (int hairyness) and operations (Throw(IThrowable))</li>\n<li><strong>Polymorphism (Inheritance and/or Interfaces)</strong> to treat specific objects in a generic fashion so you can read books as well as graffiti on the wall (both implement IReadable)</li>\n<li><strong>Encapsulation</strong> because an apple doesn't expose an Atoms[] property</li>\n</ul>\n"}, {'answer_id': 29274, 'author': 'Jörg W Mittag', 'author_id': 2988, 'author_profile': 'https://Stackoverflow.com/users/2988', 'pm_score': 6, 'selected': True, 'text': '<p><a href="http://C2.Com/cgi/wiki?DefinitionsForOo" rel="noreferrer" title="Definitions for OO on Ward&#39;s WikiWikiWeb">Definitions for Object-Orientation</a> are of course a <a href="http://C2.Com/cgi/wiki?OoBestFeatures" rel="noreferrer" title="OO Best Features on Ward&#39;s WikiWikiWeb">huge can of worms</a>, but here are my 2 cents:</p>\n\n<p>To me, Object-Orientation is all about objects that collaborate by sending messages. That is, to me, the single most important trait of an object-oriented language.</p>\n\n<p>If I had to put up an ordered list of all the features that an object-oriented language must have, it would look like this:</p>\n\n<ol>\n<li><a href="http://C2.com/cgi/wiki?MessagePassing" rel="noreferrer" title="Message Passing on Ward&#39;s WikiWikiWeb">Objects sending messages to other objects</a></li>\n<li>Everything is an Object</li>\n<li><a href="http://C2.Com/cgi/wiki?LateBinding" rel="noreferrer" title="Late Binding on Ward&#39;s WikiWikiWeb">Late Binding</a></li>\n<li><a href="http://C2.Com/cgi/wiki?PolyMorphism" rel="noreferrer" title="Polymorphism on Ward&#39;s WikiWikiWeb">Subtype Polymorphism</a></li>\n<li>Inheritance or something similarly expressive, like <a href="http://C2.Com/cgi/wiki?DelegationInheritance" rel="noreferrer" title="Delegation Inheritance on Ward&#39;s WikiWikiWeb">Delegation</a></li>\n<li><a href="http://C2.com/cgi/wiki?EncapsulationDefinition" rel="noreferrer" title="Encapsulation Definition on Ward&#39;s WikiWikiWeb">Encapsulation</a></li>\n<li><a href="http://C2.com/cgi/wiki?InformationHiding" rel="noreferrer" title="Information Hiding on Ward&#39;s WikiWikiWeb">Information Hiding</a></li>\n<li>Abstraction</li>\n</ol>\n\n<p>Obviously, this list is very controversial, since it excludes a great variety of languages that are widely regarded as object-oriented, such as <a href="http://Java.Com/" rel="noreferrer" title="Java Programming Language">Java</a>, <a href="http://MSDN.Microsoft.Com/vcsharp/" rel="noreferrer" title="C# Programming Language">C#</a> and <a href="http://Open-Std.Org/jtc1/sc22/wg21/" rel="noreferrer" title="C++ Programming Language">C++</a>, all of which violate points 1, 2 and 3. However, there is no doubt that those languages allow for object-oriented programming (but so does <a href="http://Open-Std.Org/jtc1/sc22/wg14/" rel="noreferrer" title="C Programming Language">C</a>) and even facilitate it (which C doesn\'t). So, I have come to call languages that satisfy those requirements "purely object-oriented".</p>\n\n<p>As archetypical object-oriented languages I would name <a href="http://Research.Sun.Com/self/" rel="noreferrer" title="Self Homepage at Sun Research">Self</a> and <a href="http://NewspeakLanguage.Org/" rel="noreferrer" title="Newspeak Programming Language">Newspeak</a>.</p>\n\n<p>Both satisfy the above-mentioned requirements. Both are inspired by and successors to <a href="http://Smalltalk.Org/" rel="noreferrer" title="Smalltalk Programming Language">Smalltalk</a>, and both actually manage to be "more OO" in some sense. The things that I like about Self and Newspeak are that both take the message sending paradigm to the extreme (Newspeak even more so than Self).</p>\n\n<p>In Newspeak, <em>everything</em> is a message send. There are no instance variables, no fields, no attributes, no constants, no class names. They are all emulated by using getters and setters.</p>\n\n<p>In Self, there are <em>no classes</em>, only objects. This emphasizes, what OO is <em>really</em> about: objects, not classes.</p>\n'}, {'answer_id': 29278, 'author': 'jdd', 'author_id': 242853, 'author_profile': 'https://Stackoverflow.com/users/242853', 'pm_score': 1, 'selected': False, 'text': '<p>As far as I can tell, the main view of what makes a language "Object Oriented" is supporting the idea of grouping data, and methods that work on that data, which is generally achieved through classes, modules, inheritance, polymorphism, etc.</p>\n\n<p>See <a href="http://c2.com/cgi/wiki?NobodyAgreesOnWhatOoIs" rel="nofollow noreferrer">this discussion</a> for an overview of what people think (thought?) Object-Orientation means.</p>\n\n<p>As for the "archetypal" OO language - that is indeed Smalltalk, as Kristopher pointed out.</p>\n'}, {'answer_id': 29375, 'author': 'aib', 'author_id': 1088, 'author_profile': 'https://Stackoverflow.com/users/1088', 'pm_score': 3, 'selected': False, 'text': '<p>It\'s not really the languages that are OO, it\'s the code.</p>\n\n<p>It is possible to write object-oriented C code (with structs and even function pointer members, if you wish) and I have seen some pretty good examples of it. (Quake 2/3 SDK comes to mind.) It is also definitely possible to write procedural (i.e. non-OO) code in C++.</p>\n\n<p>Given that, I\'d say it\'s the language\'s support for writing good OO code that makes it an "Object Oriented Language." I would never bother with using function pointer members in structs in C, for example, for what would be ordinary member functions; therefore I will say that C is not an OO language.</p>\n\n<p>(Expanding on this, one could say that Python is not object oriented, either, with the mandatory "self" reference on every step and constructors called <strong>init</strong>, whatnot; but that\'s a Religious Discussion.)</p>\n'}, {'answer_id': 29392, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': 0, 'selected': False, 'text': '<p>Disregarding the theoretical implications, it seems to be</p>\n\n<p>"Any language that has a keyword called \'class\'" :-P</p>\n'}, {'answer_id': 29397, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 0, 'selected': False, 'text': '<p>To further what aib said, I would say that a language isn\'t really object oriented unless the standard libraries that are available are object oriented.  The biggest example of this is PHP.  Although it supports all the standard object oriented concepts, the fact that such a large percentage of the standard libraries aren\'t object oriented means that it\'s almost impossible to write your code in an object oriented way.  </p>\n\n<p>It doesn\'t matter that they are introducing namespaces if all the standard libraries still require you to prefix all your function calls with stuff like mysql_ and pgsql_, when in a language that supported namespaces in the actual API, you could get rid of functions with mysql_ and have just a simple "include system.db.mysql.*" at the top of your file so that it would know where those things came from.</p>\n'}, {'answer_id': 216593, 'author': 'interstar', 'author_id': 8482, 'author_profile': 'https://Stackoverflow.com/users/8482', 'pm_score': 3, 'selected': False, 'text': '<p>Basically Object Oriented really boils down to "message passing"</p>\n\n<p>In a procedural language, I call a function like this :</p>\n\n<pre><code>  f(x)\n</code></pre>\n\n<p>And the name f is probably bound to a particular block of code at compile time. (Unless this is a procedural language with higher order functions or pointers to functions, but lets ignore that possibility for a second.) So this line of code can only mean one unambiguous thing.</p>\n\n<p>In an object oriented language I pass a message to an object, perhaps like this :</p>\n\n<pre><code> o.m(x) \n</code></pre>\n\n<p>In this case. m is not the name of a block of code, but a "method selector" and which block of code gets called actually depends on the object o in some way. This line of code is more ambiguous or general because it can mean different things in different situations, depending on o.</p>\n\n<p>In the majority of OO languages, the object o has a "class", and the class determines which block of code is called. In a couple of OO languages (most famously, Javascript) o doesn\'t have a class, but has methods directly attached to it at runtime, or has inherited them from a prototype.</p>\n\n<p>My demarcation is that neither classes nor inheritance are necessary for a language to be OO. But this polymorphic handling of messages is essential.</p>\n\n<p>Although you can fake this with function pointers in say C, that\'s not sufficient for C to be called an OO language, because you\'re going to have to implement your own infrastructure. You can do that, and a OO style is possible, but the language hasn\'t given it to you.</p>\n'}, {'answer_id': 2068956, 'author': 'user217299', 'author_id': 217299, 'author_profile': 'https://Stackoverflow.com/users/217299', 'pm_score': 0, 'selected': False, 'text': '<p>when you can make classes, it is object-oriented<br>\nfor example : java is object-oriented, javascript is not, and c++ looks like some kind of "object-curious" language  </p>\n'}, {'answer_id': 3791097, 'author': 'philosodad', 'author_id': 209933, 'author_profile': 'https://Stackoverflow.com/users/209933', 'pm_score': 0, 'selected': False, 'text': "<p>In my experience, languages are not object-oriented, code is.</p>\n\n<p>A few years ago I was writing a suite of programs in AppleScript, which doesn't really enforce any object-oriented features, when I started to grok OO. It's clumsy to write Objects in AppleScript, although it is possible to create classes, constructors, and so forth if you take the time to figure out how.</p>\n\n<p>The language was the correct language for the domain: getting different programs on the Macintosh to work together to accomplish some automatic tasks based on input files. Taking the trouble to self-enforce an object-oriented style was the correct programming choice because it resulted in code that was easier to trouble-shoot, test, and understand. </p>\n\n<p>The feature that I noticed the most in changing that code over from procedural to OO was encapsulation: both of properties and method calls.</p>\n"}, {'answer_id': 14837498, 'author': 'Alborz', 'author_id': 1541221, 'author_profile': 'https://Stackoverflow.com/users/1541221', 'pm_score': 0, 'selected': False, 'text': '<p>Simples:(compare insurance character)</p>\n\n<p>1-Polymorphism\n2-Inheritance\n3-Encapsulation\n4-Re-use.\n:)</p>\n'}, {'answer_id': 42747364, 'author': 'Adnan Alisa', 'author_id': 6408077, 'author_profile': 'https://Stackoverflow.com/users/6408077', 'pm_score': 0, 'selected': False, 'text': '<p>Object: An object is a repository of data. For example, if MyList is a ShoppingList object, MyList might record your shopping list.</p>\n\n<p>Class: A class is a type of object. Many objects of the same class might exist; for instance, MyList and YourList may both be ShoppingList objects.</p>\n\n<p>Method: A procedure or function that operates on an object or a class. A method is associated with a particular class. For instance, addItem might be a method that adds an item to any ShoppingList object. Sometimes a method is associated with a family of classes. For instance, addItem might operate on any List, of which a ShoppingList is just one type.</p>\n\n<p>Inheritance: A class may inherit properties from a more general class. For example, the ShoppingList class inherits from the List class the property of storing a sequence of items.</p>\n\n<p>Polymorphism: The ability to have one method call work on several different classes of objects, even if those classes need different implementations of the method call. For example, one line of code might be able to call the "addItem" method on every kind of List, even though adding an item to a ShoppingList is completely different from adding an item to a ShoppingCart.</p>\n\n<p>Object-Oriented: Each object knows its own class and which methods manipulate objects in that class. Each ShoppingList and each ShoppingCart knows which implementation of addItem applies to it.</p>\n\n<p>In this list, the one thing that truly distinguishes object-oriented languages from procedural languages (C, Fortran, Basic, Pascal) is polymorphism.</p>\n\n<p>Source: <a href="https://www.youtube.com/watch?v=mFPmKGIrQs4&amp;list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd" rel="nofollow noreferrer">https://www.youtube.com/watch?v=mFPmKGIrQs4&amp;list=PL-XXv-cvA_iAlnI-BQr9hjqADPBtujFJd</a></p>\n'}, {'answer_id': 53208990, 'author': 'Joule87', 'author_id': 8513770, 'author_profile': 'https://Stackoverflow.com/users/8513770', 'pm_score': 2, 'selected': False, 'text': '<p>I am happy to share this with you guys, it was quite interesting and helpful to me. This is an extract from a 1994 Rolling Stone interview where Steve (not a programmer) explains OOP in simple terms.</p>\n\n<p>Jeff Goodell: Would you explain, in simple terms, exactly what object-oriented software is?</p>\n\n<p>Steve Jobs: Objects are like people. They’re living, breathing things that have knowledge inside them about how to do things and have memory inside them so they can remember things. And rather than interacting with them at a very low level, you interact with them at a very high level of abstraction, like we’re doing right here.</p>\n\n<p>Here’s an example: If I’m your laundry object, you can give me your dirty clothes and send me a message that says, “Can you get my clothes laundered, please.” I happen to know where the best laundry place in San Francisco is. And I speak English, and I have dollars in my pockets. So I go out and hail a taxicab and tell the driver to take me to this place in San Francisco. I go get your clothes laundered, I jump back in the cab, I get back here. I give you your clean clothes and say, “Here are your clean clothes.”</p>\n\n<p>You have no idea how I did that. You have no knowledge of the laundry place. Maybe you speak French, and you can’t even hail a taxi. You can’t pay for one, you don’t have dollars in your pocket. Yet, I knew how to do all of that. And you didn’t have to know any of it. All that complexity was hidden inside of me, and we were able to interact at a very high level of abstraction. That’s what objects are. They encapsulate complexity, and the interfaces to that complexity are high level.</p>\n'}, {'answer_id': 65654881, 'author': 'Nitin Thakur', 'author_id': 10406813, 'author_profile': 'https://Stackoverflow.com/users/10406813', 'pm_score': 0, 'selected': False, 'text': "<p><em>If a language is designed with the facilities specifically to support object-oriented programming(4 features) then it is an Object-oriented programming language.</em></p>\n<ul>\n<li><p>You can program in an object-orientated style in more or less any language.It’s the code that is object-oriented not the language.</p>\n</li>\n<li><p>Examples of real object-oriented languages are Java, c#, Python, Ruby, C++.\nAlso, it's possible to have extensions to provide Object-Oriented features like PHP, Perl etc.</p>\n</li>\n<li><p>You can write an object-oriented code with C but it is not object-oriented prog. lang. It is not designed for that (that was the whole point of c++)</p>\n</li>\n</ul>\n"}]
['https://Stackoverflow.com/questions/29099', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3121/']