Select Page

The question is contentious, because “purity” in this instance is subjective.

The answer depends on your definition of “Pure” in this context. Some will say that unless everything is an Object, then it is not Pure. In Java, not everything is an Object so it is not Pure.

Others will say it does support all the structural requirements of modern object-orientation, including: encapsulation, information/implementation hiding, state retention, object identity, messages, polymorphism and genericity. So Java is Pure. [1]

However, others might say it is not Pure, because one can also program in a procedural or pseudo-functional style and only use Objects as containers for data, and/or namespaces for functions, as Abstract Data Types (ADTs), or to represent Entities in Information Modeling.

Yet others say it is Pure because it fully supports solving a problem or representing a system using an object-oriented style. This is in contrast to representing a problem using modular programming, functional decomposition or a data modeling approach.

I think that Java can be argued to be Pure because it supports the key tenets of Simula 67, particularly “classes”, and Alan Kay’s big insight – arguably his eureka moment – “… the insight that everything we can describe can be represented by the recursive composition of a single kind of behavioral building block that hides its combination of state and process inside itself and can be dealt with only through the exchange of messages.” [3]

That you can do other things in Java as a hybrid language?  Consider them a bonus.


[1] Java doesn’t support Alan Kay’s “extreme late-binding of all things” [2], but he did write that in 2003, and he doesn’t own the definition.
[2] Dr. Alan Kay on the Meaning of “Object-Oriented Programming”
[3] An Early History of Smalltalk – Alan Kay

Share This