Hacker News new | past | comments | ask | show | jobs | submit login

OOP is pretty well defined.

99% of the time it means type dependent namespaces.

Class A.foo and Class B.foo both represent separate namespaces in which a field or method foo can be defined, the name space is directly tied to a type. In Haskell every function is defined in what amounts to be a global namespace. This is particularly annoying when you have records that share the same attribute names.

You might argue that structs fit this definition but they are missing type dependent namespaces for functions/methods and the fact that you can define fields and methods to only be accessible within their type dependent namespace, not outside of them.




By that, then, you mean undefined.

It once meant that three features appeared: encapsulation, inheritance, and constrained runtime binding.

Any time it is used without implying those, it is just more or less noise.

That said, OO has become a niche technique: it fits certain problem spaces well, others very badly. Any big enough system will have some parts that could meaningfully be described as mostly OO. But there is no value in purity, so none in distinguishing those bits, particularly, or excluding non-OO notions there.

Trying to cram all solutions into the OO shoe by providing no support for any other organization (cough Java) damaged the brand, probably irreparably. It still makes sense to say part of a system has an OO flavor, for exposition, but there is little value, otherwise.


I think we have to look to Alan Kay for an original definition, since he invented the term, and according to him, inheritance is not a necessary part of object orientation. In Smalltalk (and various Lisps), inheritance is something that is created from objects and messages, not a fundamental feature of the language. In [one place](http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay...) he defines it as "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things."


Alan Kay's definition of OO has drifted over the years as he tries to exclude any language that is not Smalltalk.

He is free to do that, but we have no need to play along.


This is the fruitful definition of OOP to me. None of that Java Corporate insanity


I love how the well-defined starts with a definition I've never heard for OOP.


Is using structs in C OOP by that definition?


Would be, but isn't.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: