Object-oriented programming is the third major programming paradigm. There has been a tendency to paint the functional paradigm and the object-oriented paradigm as competing, but I believe them to be complementary techniques that work well together, which I will try to demonstrate in this chapter. At its heart, object-oriented programming has a few simple ideas, sometimes referred to as the tenets of object-oriented programming: encapsulation, polymorphism, and inheritance.
Possibly the most important tenet is encapsulation, the idea that the ...