To discuss what Object Oriented Programming is, let’s discuss the problem it was designed to solve. Well, let’s get as close as we can to an explanation while keeping this readable for non-coders.
Originally, programming was procedural…
Note: This is different from the kind of “procedural” you find in No Man’s Sky or FUEL. In those games, when we say “procedural” we mean the art assets are created by the program using a set of procedures. In the field of writing code, when we say “procedural” we just mean a program is nothing more than a set of procedures to follow, one after the other. It’s the most obvious and direct way to go about writing software: You tell the computer what to do.
…but the problem (the argument goes) is that procedural programming (PP) can get out of hand in terms of complexity.
Let’s say we’ve got a game. We’ve got a big list of (say) space marines taking part in the simulation. Each space marine is nothing more than a block of data describing where it is, how it’s moving, what weapon it has, how many hit points it has, what team it’s on, what it’s AI is up to, what character model it’s using, if it’s dead, and so on.
Here, let’s make up a pretend data structure to hold our marine:
Continue reading 〉〉 “Object-Oriented Debate Part 2: Okay, so what is OOP?”
Shamus Young is a programmer, an author, and nearly a composer. He works on this site full time. If you'd like to support him, you can do so via Patreon or PayPal.