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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access