pointer-image   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!”

images/devil.png

“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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.