Many are familiar
with the concept of the Turing machine,
the mathematical model of computation that gives us the phrase
“Turing Complete”.
A Turing machine is built of several parts:
a finite alphabet of symbols,
an infinite tape divided into cells marked by these symbols,
a read/write head that can modify the tape,
and a finite set of control states
that determine what should be written
and how the tape should be moved
depending on what is read.
Less familiar but much simpler
is the λ-calculus of Alonzo Church.
Equivalent in expressive power to the Turing machine,
the λ-calculus has only
the creation and application of single-argument functions.
Often, a programmer will be faced with a sequence of data
from which only certain elements should be retained
for further processing.
For example, in a game, one might have a list of entities
and wish to keep only those that are alive and within the loading zone.
Or in a text processing task,
one might wish to select only records
which begin with a valid date (per ISO 8601)
within the past year.
This is called a “filter” or “select” operation.
We will walk through a few different ways
that one might implement this,
and discuss the implications of each.
What is object-oriented programming?
My position is that, fundamentally,
it is a style of programming that revolves around
structured data (objects) that dictate their own behaviors.
That is, it has very little to do
with any particular language features.