Object-Oriented Programming Languages

Object Oriented Programming (OOP) is a way of designing and organizing software using "objects," which are self-contained structures that hold both data and functionality.

The ideas for OOP grew out of Simula, a language used for simulation programming. In Simula programs, a simulation of a car might have various data points (current speed, current location, RPMs, gas tank level) and also functions (turn the car on, turn it off, turn on windshield wipers). The car object encapsulates all of these into a single object that other objects in the system can interact with.

These ideas were expanded from real-world simulation to more abstract software system concepts with the advent of the Smalltalk programming language in the 1970s. Smalltalk's inventor, Alan Kay, was the first person to fully articulate a concept of object orientation. These ideas were further developed through the 80s and 90s, especially under the influence of the Design Patterns movement.

General Resources on Object Oriented Programming

Object-oriented programming is such an important concept that there are many resources that deal with it in an abstract way.

Online

Here are some of the best online resources that we've found:

Books

OOP rose to prominence just before the internet and World Wide Web became ubiquitous. Because of this, many of the best classic resources are only available as print books.

Object Modeling and UML

Modeling — the art and science of designing software in pictures and diagrams before writing code — is a major part of serious object-oriented design culture. While you can write classes and instantiate objects without first drawing pictures of them, many of the most important benefits to OOP can only be realized in conjunction with model-based design.

The Universal Modeling Language was developed specifically to enable OOP system modeling, and is the standard way of illustrating OOP programs and programming patterns.

If patterns, designs, and modeling really interest you, you should check out The Timeless Way of Building, by Christopher Alexander. This book on architecture (buildings, not software) was hugely influential on the OOP and design patterns movement.

OO Resources by Language

Not all programming languages support object-oriented programming. Some languages are designed to do nothing but support OOP. Others allow for a variety of approaches to programming. Still others appear to be object-oriented, but implement the concepts of object orientation in non-standard, incomplete, or just plain unusual ways.

Below is a list of some of the more popular OO-capabable languages, with notes about their approach to Object Orientation, and some resources to help you get into OOP with that language.

The internet is filled with essays that look at language X vs language Y — most of which just scratch the surface. We suggest you check out this more general Programming Language Comparison. This thoughtful analysis looks at specific details of several popular OO languages, discussing how particular OO concepts are implemented in each.

C-Based Languages

C is not an object-oriented language. However, it is at least possibleto write OO code in it:

None of the techniques described in those books and articles are particularly robust or easy to deal with for non-trivia programs. Rather than trying to stretch C to its limits, there are three direct descendants of C which include object-oriented language tools.

C++

C++ is multi-paradigm, which means that it supports several different programming methods (PDF), including object-orientation. It is based on C, and developed specifically as a way to add support for OOP's concept of classes.

C#

C# ("C sharp") is another C derivative, mostly designed as an improvement over C++ for use in Microsoft's .NET Framework.

Objective-C

Objective-C was developed about the same time as C++, with essentially the same goal — the addition of OOP capabilities to C. Today, Objective-C is really only used in Apple's Cocoa Development Platform for OS X and iOS, and GNUstep, its Open Source alternative.

Common Lisp

Lisp is not essentially Object Oriented. However Common Lisp, one of the more popular Lisp dialects, includes the Common Lisp Object System (CLOS), which provides OOP features.

The approach to Object Orientation implemented in CLOS is radically different than the way OO is handled in other languages. This means that CLOS is not a great place to start if you want to learn OO in general, or apply OO in other types of languages. However, if you are getting into Lisp, CLOS is very important. Additionally, if you find OOP especially intriguing, you'll enjoy studying CLOS to see OO concepts in a different light.

Erlang

According to some conventional points of view, Erlang is not an object-oriented language. However, there is a fascinating minority opinion to the contrary, and its proponents state that Erlang Is the Most Object Oriented Language, or even that Erlang is the only true Object Oriented language.

Much of this also applies to Elixir, as well. On other hand, maybe this is just OO-style, not true OO.

F#

F# ("F sharp") is a multi-paradigm language. Its core is really functional programming, but it includes support for OO and attempts to reconcile these two different approaches to programming.

Fortran

Fortran is the oldest programming language still in common use. When it was invented in the 1950s, there was no such thing as object orientation. Explicit OOP support was added to Fortran with the Fortran 2003 release of the language. But it was possible to implement some basic OOP concepts in earlier versions of the language.

Go

Go is a relatively new language, having been developed by Google in 2007. There is a lot of discussion about whether or not Go is object-oriented.

Go doesn't have anything in it called "object" or "class," but it does have some analogous structures. From a certain point of view, then, you can think of Go as object oriented.

Many people in fact do think that Go is OO:

Java

Java was built from the ground up to be object-oriented. Here are some great resources to get you going with Java:

JavaScript

A lot of people don't think that JavaScript is really object oriented. But a lot of other people think that it definitely is.

We feel our job is to help you find useful resources, not take sides in unwinnable debates. So here are some OOP resources for JavaScript:

PHP

PHP did not support even basic OO concepts until version 4, and didn't support full object orientation until PHP5.

Python

Python codes does not need to be object-oriented, but the language fully supports it. Check out these resources:

Ruby

In Ruby everything is an object, even "primitive" data types like strings and integers. You add two integers by calling the addition method on one of them; you find the length of a string by calling the length method on it.

Smalltalk

Smalltalk is probably the most influential object-oriented language, having had a profound effect on the languages that came later. As a result, it is good to have at least some familiarity with it. These resources will get you started:

On the Other Hand...

If you want to be a well-rounded developer, it is important to understand both the good and bad of any concept. Even though object orientation has become the dominant way of understanding programming, there are legitimate criticisms to be made — both of the ideas themselves, and the culture of hype surrounding them.

Here are a handful of resources presenting the counter-argument to OOP:

Bottom Line on OOP

Object-oriented programming is the dominant mode of software development today, and has been since the beginning of the 21st century. While other modes of writing software (eg, imperative programming) are certainly valid and useful, no developer can really afford to not understand object orientation — both as a way of coding and as a way of analyzing and designing software systems.


Further Reading and Resources

We have more programming guides, tutorials, and infographics related to coding and development:

  • C++ Developer Resources: in addition to information about C++, there is more information about object-oriented programming.
  • Linux Programming Introduction and Resources: although not specifically about object oriented programming, this discussion of the many levels of Linux programming is bound to energize you.
  • INTERCAL Introduction and Resources: if you find object-oriented programming hard, studying INTERCAL will make it seem easy. This parody (or joke) language is so complicated and horrible that even the deepest discussion of polymorphism will seem pleasant.

What Code Should You Learn?

Confused about what programming language you should learn to code in? Check out our infographic, What Code Should You Learn? It not only discusses different aspects of the languages, it answers important questions such as, "How much money will I make programming Java for a living?"