31 Tell, Don’t Ask
“Don’t trust other objects. After all, they were written by other people, or even by you last month when you weren’t as smart. Get the information you need from others, and then do your own calculations and make your own decisions. Don’t give up control to others!” |
“Procedural code gets information and then makes decisions. Object-oriented code tells objects to do things.” Alec Sharp Smalltalk by Example: The Developer’s Guide [Sha97] hit the nail on the head with that observation. But it’s not limited to the object-oriented ...
Get Practices of an Agile Developer 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.