Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Java or C++ lack any OO features?

Tags:

java

c++

oop

I am interested in understanding object-oriented programming in a more academic and abstract way than I currently do, and want to know if there are any object-oriented concepts Java and C++ fail to implement.

I realise neither of the languages are "pure" OO, but I am interested in what (if anything) they lack, not what they have extra.

like image 255
tsvallender Avatar asked Mar 16 '10 19:03

tsvallender


1 Answers

In the words of Alan Kay, the inventor of the term "object orientation":

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.

C++ obviously fails the "extreme late-binding" criterium, and both Java and C++ fail the "messaging" criterium, due to their rigid class/method structure. As I understand it, Kay's concept considers methods with a specific name and signature a convenient way to implement message handlers, but by no means the only one.

Other interesting statements from the same email:

I didn't like the way Simula I or Simula 67 did inheritance [...] So I decided to leave out inheritance as a built-in feature until I understood it better.

and

The term "polymorphism" was imposed much later (I think by Peter Wegner) and it isn't quite valid, since it really comes from the nomenclature of functions, and I wanted quite a bit more than functions.

like image 69
Michael Borgwardt Avatar answered Sep 19 '22 17:09

Michael Borgwardt