8 ms·
OO is a great example of Chinese whispers. The original idea behind it is more in line with Erlang or functional programming in general than what we have today
by ilovecaching 8y ago
OO is a great example of Chinese whispers. The original idea behind it is more in line with Erlang or functional programming in general than what we have today in Java or Python.
That’s why I’m adamant that existing OO languages need to die. They’re abominations of good ideas that make things worse. C++, Java, Python, are all founded I’m confused interpretations of OO. OO has also become so synonymous with these implementations that we should just let the paradigm go entirely and start afresh.
- Bekwnn 8y agoC++ isn't object oriented, it's a hodge-podge mix of many things. It did start out as "C with objects", but that implies it's also C which largely operates without the OO notions of objects.
- mattnewport 8y agoC++ isn't like Java in this sense, it's a multi paradigm language and you can use it effectively without ever doing Java style OOP. The STL is mostly OOP free because Alexander Stepanov recognized that it was mostly a bad idea and a lot of modern C++ doesn't use inheritance, virtual functions, abstract classes, getters and setters or a lot of the other Java style OOP junk except sometimes as an implementation detail.
- ilovecaching 8y agoI’ve never once worked in a C++ code base that didn’t make use of OO. As long as it’s available, it will be used.
- mattnewport 8y agoFor most of the C++ code I write removing inheritance and virtual functions from the language wouldn't have much impact (although a few abstractions might have to be implemented differently under the hood). The same cannot be said for Java.
- pjmlp 8y agoApparently now it is common to forget that Java style OOP junk was originally mid-90's C++. STL builds up on OOP abstractions, class templates, static method dispatch, type polymorphism, abstract classes for allocators, iostreams, base classes for data structures common methods.
- mattnewport 8y agoSTL is just the containers / iterators / algorithms part of the standard library, the part that Alexander Stepanov designed and originally implemented. Most of the less pleasant parts of the standard library like iostreams come from elsewhere. Templates, static method dispatch and type polymorphism are not really part of OOP, certainly not Java style OOP. Abstract classes for allocators are a very recent addition with polymorphic allocators and are a good example of OOP features being used in modern C++ as more of an implementation detail (a way to get dynamic dispatch / type erasure).
- pjmlp 8y agoIt is C++ OOP, regardless of how Java does it. Java is not the last word in what OOP means in practice, and is a younger language, which took many OOP ideas from C++ OOP libraries that were current when Java was designed. In fact something like J2EE was a relief versus using CORBA or DCOM/MTS, kings of OOP boilerplate. Or the surviving king of C++ GUI frameworks, Qt. As for the STL part you refer to, the original one, containers / iterators / algorithms, it makes use of C++ classes, methods, aggregation and delegation, which are definitely OOP. OOP doesn't have a rule that it is only OOP when all concepts are used in every single class.
- mattnewport 8y agoThe STL is more derived from Abstract Data Types than from OOP but there is overlap between those. Basically the good parts of OOP is ADTs and are embodied in the STL, the bad parts are most of the rest and are embodied in Java.
- 8y ago