SamWhited|blog

A brief history of object-oriented programming languages

Before the 1950’s procedural programming was thought to be the only plausible programming paradigm and any methodology which was not fully imperative was considered difficult or impossible to implement. However, as computers began to become faster, programming languages began to become declarative and higher level though the languages of this time were still difficult for humans to read and understand. This meant that problems to which computers could be applied were limited in scope by their complexity. Then, in the 1950’s a group of computer scientists published a paper detailing a new language designed to express algorithms. This language, ALGOL 60, introduced two ideas which changed the way people programmed and thought about programming related problems. ALGOL’s first innovation was lessening computers dependence on procedures and introducing the idea of nested code blocks which did not need to be explicitly named. This meant that program flow became much more natural and easier for humans to read without jumping around a document searching for entry and exit points. Secondly, ALGOL introduced the concept of scope, a basic implementation of one of object-oriented programming’s key ideas. Lexical scoping allowed each code block to have its own set of variables which other code blocks did not have access too. This meant that debugging code became much easier because one rouge piece of code could not affect other areas of the program to the same degree that it could before. Not only did ALGOL 60 introduce ideas that would be key to object-oriented design later on, but it also abstracted itself even further from the hardware than other previous languages by using a mathematically exact notation which made its code even easier for humans to read and manipulate. Unfortunately ALGOL’s syntax had a steep learning curve which deterred new users. In 1972 Bell Laboratories’ Dennis Ritchie created the C programming language. It was commonly believed that an operating system could not be programmed in anything but Assembly (the lowest level human readable programming language), but Ritchie set out to prove otherwise by designing a language which was independent of computer architecture and could work at a very low level while still being a mid-level language which was easy to read and write by humans. With C Ritchie then set out to design the Unix operating system. At around the same time one of the first truly object-oriented languages came into existence: Smalltalk. Smalltalk allowed users to define blocks of code as discrete, explicitly named “objects” each of which contained its own procedures and data (collectively called the objects ‘state’) and no object could modify the state of any other object without the appropriate permissions. Each of these objects could send messages back and forth and these interactions between individual objects gave rise to program flow. This abstraction of the way we perceive the real world (as a collection of objects which inherit properties from one another) made programming a great deal easier for the average mortal. However, it came at a cost: overhead. Object-oriented programming languages often had a much greater space and time complexity than the same program written in a procedural language. Even though transistors were becoming increasingly small and computers exceedingly fast this still turned many developers away from object-oriented languages. What was needed was a language which had the simplicity, and speed of C while still being as flexible as Smalltalk. Enter C++. In 1979 Bjarne Stroustrup of Bell Labs wrote an enhancement to the C language called “C with Classes”. It was renamed C++ (pronounced See-Plus-Plus) in 1983 after C’s “++” operator which increments a value by one. Originally C with Classes merely added objects (classes are the templates from which one creates objects), but was later expanded into a full programming language which added other object-oriented staples including polymorphism (the ability of one object to inherit and use the properties of another object) and multiple inheritance (a polymorphic chain of inheritance).