Day 15. Toward Habitable Interfaces

It's easy for my mind. I hope it's easy for yours too.

—Matz (creator of Ruby), on the comp.lang.ruby newsgroup

The less a user is required to remember, the better. Remember that!

When building a class, you have to think about how it works, and you always want to make sure it works well. When writing other code that uses that class, on the other hand, you want to forget about the class's inner workings and remember only its interface. That is, you remember only the method names and what results they're supposed to accomplish. You assume a different role, taking off a Class Builder hat and putting on a Class User hat. Since writing object-oriented code on anything beyond the small scale often means creating ...

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.