Chapter 4. Understanding objects and classes

4.1 Why objects and classes are a good idea 66
4.2 Criteria for good design 76
4.3 What are objects, anyway? 82
4.4 Summary 85

If you want to confess a crime, you can say, “I shot the sheriff.”

If you want to write an academic paper about it, you express the same thing differently, something like this: “The shooting of the sheriff was carried out by the present author.”

The key difference between the two is that a verb becomes a noun; the verb form of shoot in the first one is replaced with the noun shooting in the second one. Experts on good writing style will tell you that the best one is the first, plainer way of putting it. It’s more immediate and easier to read; it gets your point across with ...

Get PHP in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.