What Is an Object?

Alas, this is a question that shouldn't have to be asked.

Something went wrong years ago when object-oriented programming was a new idea. Maybe C++, the language many of us were first told was object-oriented, didn't quite live up to the billing. Maybe the people teaching it just couldn't break their old procedure-oriented habits. Maybe the language theorists got so happy when burbling about encapsulation, polymorphism, data hiding, and so on, that they forgot to talk plain talk for the benefit of people trying to learn to program. Objects were supposed to make things easier for everybody, but somehow they turned into just one more weird concept to trip over.

But you can let your intuition be correct: an object is what you ...

Get Sams Teach Yourself Ruby in 21 Days 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.