Re:Avoid Null Checks by Replacing Finders with Tellers
by masklinn on Monday June 17, 2013 @01:41PM
(#5894603)
This dovetails into the classical "tell, don't ask": without good support for anonymous functions or blocks, for a number of operations you'll have to ask an object for parts of its internal state, munge that state then shove it back into the object. Said object may return a command protocol instead, but it's generally verbose and exceedingly rare.
Blocks provide a conduit to provide compound and possibly complex commands while leaving the object itself in charge.
Blocks provide a conduit to provide compound and possibly complex commands while leaving the object itself in charge.