Object oriented programming (OOP) is a programming model where code and data are encapsulated into units called objects that behave semi-autonomously. Interaction between objects is arranged through subroutines called methods that are object specific. Modularity of objects makes for an easy transferability between different applications. Objects are arranged into hierarchies of classes with objects at lower levels inheriting methods from the upper level classes but also adding more specialized ones of their own. So classes can be used as object constructors.
It is hard not to notice the structural analogy between OOP and the mathematical category theory with objects related by specialized morphisms and arranged into categories with transferability corresponding to categorical “up to isomorphism”. The analogy is well known and goes deeper, e.g. there are OOP analogs of some functorial constructions (inheritance, polymorphism, etc.). In fact OOP is somewhat of a constructivist implementation of the category theory. Were such parallel structures really developed independently from completely different motivations?
The category theory was created by Eilenberg and Mac Lane in mid 1940-s while formalizing homological algebra, and it seems that most of the motivation came from algebraic topology, and in 1950-s also from algebraic geometry, when Grothendieck and Bourbaki got involved. Not from the theories of algorithms and formal languages, also actively studied at the time. Similarly, OOP was originally developed by MIT AI group (McCarthy, Minsky, Sutherland , etc.) in late 1950-s, and much of the overall structure and terminology is due to Dahl and Nygaard from Norwegian Computing Center in early 1960-s.
Were such parallel structures really developed independently from completely different motivations? Mac Lane held a position at Harvard from 1938 to 1947, so perhaps he left a mark in Cambridge, where MIT is also located, but this is very tenuous. McCarthy, who created LISP in 1958 at MIT was explicitly motivated by Church’s lambda calculus, but that belongs more to the general theory of algorithms than categories per se. There is no connection I could find to Dahl or Nygaard. Even later relations between mathematics and programming that are pointed out, like Curry-Howard correspondence (“every proof is a program”) and Martin-Löf’s work on type theory, are not specifically categorical. Lawvere is mentioned as categorifying the Curry-Howard correspondence later, but I am not sure if even he was motivated by OOP.
Were creators of OOP influenced, directly or by osmosis, by the category theory structures (perhaps lectures on category theory were offered at MIT at the time, and somebody from AI group attended them)? When was the analogy first explicitly made, and how did it influence both areas?