This chapter introduces the basic ideas of object-oriented programming. Different people put different meanings into the term object-oriented programming: Some use the term for programming with objects in general, while others use the term for programming with class hierarchies. The author applies the second meaning, which is the most widely accepted one in computer science. The first meaning is better named object-based programming. Since everything in Python is an object, we do object-based programming all the time, yet one usually reserves this term for the case when classes different from Python's basic types (int, float, str, list, tuple, diet) are involved.
A necessary background for the present chapter is Chapter 7. For Chapters 9.2 and 9.3 one must know basic methods for numerical differentiation and integration, for example from Appendix A. Chapter 9.4 requires knowledge of numerical solution of ordinary differential equations, which is treated in Appendix B and Chapter 7.4. It takes time to grasp the ideas of object-oriented programming, but it will hopefully become clear through many examples. During the initial readings of the chapter, it can be beneficial to skip the more advanced material in Chapters 9.2.3-9.2.6 and 9.4.7-9.4.9.
All the programs associated with this chapter are found in the src/oo folder.
Was this article helpful?