I understand class examples like animals in a game, but what kinds of problems was object-oriented programming used for when computers were much simpler? Did it have a main use back then?
What was object-oriented programming used for before modern software?
Answers
Simulation is a good place to start. Simula, developed in the 1960s, introduced class concepts for describing things in a simulation, along with their state and behavior. Instead of scattering the details of each simulated entity throughout a program, you could represent entities as separate units.
That was useful even on limited hardware because the complexity being managed was in the problem and the program, not just in the computer itself. A simulation could involve lots of interacting entities even if the machine running it was slow by modern standards.
Reply to this answer
Smalltalk is another useful part of the history. Its approach emphasized objects communicating through messages and keeping their internal details behind those interactions. That's a broader idea than just making a class hierarchy.
Smalltalk was also associated with early graphical interfaces. Windows, views, and controls are a natural example: each component has its own state and can respond to actions, while larger interface components contain smaller ones.
Reply to this answer
The timeline is a little later for C++. Work on its predecessor, C with Classes, began around 1979, and the C++ name came in the 1980s. It wasn't the origin of object-oriented programming.
C++ brought class-based techniques into a language also intended for systems programming. Different object-oriented languages emphasized different things, so it is worth separating the history of the general idea from the history of C++.
Reply to this answer
There wasn't one universal job for OOP. It's a way to organize code, not a kind of calculation only certain computers can do. Desktop interfaces and business software are examples where objects can represent components or records with associated behavior.
Older machines had less memory and processing power, but programmers still had to deal with complicated requirements and code that needed changing. Those constraints didn't eliminate the need for abstraction.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Ruvlen+7d:
So the animal examples are a teaching version of the same general idea, rather than the original reason for it?
d.509!cachewheel:
Pretty much. A simulated entity can have its own state and behavior, though real programs don't have to look like neat animal family trees.