Abstract
A study by Potok, et al. has shown no significant difference in productivity between OOP and procedural approaches.—Wikipedia, s.v. Object-oriented programming.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
See Wikipedia/Object-oriented programming/criticism.
- 2.
An abstraction in programming is considered to have two parts: interface and implementation. A class interface is the collection of methods—e.g., getters, setters, finders, modifiers, reporters, etc.—that are used to manipulate the data. The implementation consists of the private methods, and the primitive statements in the body of all of the class’s methods. The benefit is that details are abstracted away from (hidden from) the interface. This makes coding easier. For all classes, the minimum number of method types you need is six: constructor, getter, setter, mutator (to change parts of an object), comparison of objects (=, !=, and maybe >), and a printer. In Python you don’t actually need getters and setters—e.g., Oop.x = 5, an Oop.setX(5) is not necessary.
- 3.
No cross product diagram with units can be drawn to scale. If vectors A and B have scalars in terms of meters, the perpendicular cross product vector C = AxB will have scalars in terms of square meters. Also note that scalars in a vector must all have no units or must all have identical units. Otherwise the magnitude will not exist. I was told this by a physics teacher, and curiously never found this fact in a math book. Later I found this mistake in David R. Causton’s otherwise excellent book, A Biologist’s Mathematics (London: Edward Arnold, 1977), page 37. The author tried to find the “distance” between two plant species by measuring both stalk lengths and the number of flowers.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Michael Stueben
About this chapter
Cite this chapter
Stueben, M. (2018). Beware of OOP. In: Good Habits for Great Coding. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3459-4_16
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3459-4_16
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3458-7
Online ISBN: 978-1-4842-3459-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)