OOP vs DDP
Let’s start off with introducing our
Fighters, in the red corner we have OOP or object oriented programing. OOP
represents code as objects that have data fields (defining attributes) and
associated procedures know as methods. The code of OOP is done through classes
that contain the defining features of an object. OOP will usually have
inheritance to increase its usability.
For example, we can have a class that defines a Ferrari which inherits
from the class car. The class car or object car is a base class that defines
the car and the Ferrari class or object expands on the functionality.
In the blue corner we have DDP or
data driven programing. DDP code groups the data and the processing required
rather than defining a sequence of steps to be taken. The code of DDP is done
through classes as well but instead of defining an object, it defines a data
process. This means that if we were to take the same example of a Ferrari, the
classes would define processes. The Ferrari would be an Entity that has many
components. The components would be stuff like rendering, transform, etc. DDP
is usually implemented in a component based engine like unity3D.
There are benefits to both methods
as well as their fair share of draw backs. OOP is more user friendly and more
readable for a programmer. It is also easier to debug because code is set up
again in a readable way. In contrast, DDP is the opposite; it can be hard to
read and debug. DDP is faster and more cache coherent then OOP because the data
and its processes are streamlined. Streamlining data means that the CPU doesn’t
have to stop and look for data because all the data it needs is tightly packed
in its cache.
The game I have been working on is programed using OOP because
we were really only formally introduced to DDP mid-way through the semester. I
have worked with DDP, however, because I have made many games in unity3D which
is a data driven engine.


