<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><br><hr id="stopSpelling">&gt; Date: Sat, 28 Jul 2007 09:43:15 +0200<br>&gt; From: cdegroot@gmail.com<br>&gt; To: squeak-dev@lists.squeakfoundation.org<br>&gt; Subject: Re: Message Eating Null - article<br>&gt; <br>&gt; I think it *is* an honest argument. One of the strong points of<br>&gt; Smalltalk is its readability, and that code block was awful in that<br>&gt; respect.<br><br>The block itself, or you mean the #inject:into:?&nbsp; If you just mean the block, then I must say that's quite a reaction!&nbsp; I would certainly have switched to #ifNotNil: or something before committing it to a repository but it wasn't *that* bad.<br><br>If you mean the #inject:into: then I disagree.&nbsp; To me the truly interesting thing about Smalltalk is it's beautiful mix of OO and functional programming.&nbsp; I don't go around throwing #inject:into: into everything I see, but in this case the example was an obvious traversal that would either require creating a new class (as he did) or using a general operator to short-circuit a call chain if a nil shows up (since nil was an acceptable value).&nbsp; In my personal opinion the #inject:into: would be more readable unless you specifically point out that a NullObject pattern is being used.&nbsp; But certainly wouldn't want some preference somewhere that says "switch my image to null pattern".<br><br>Writing unreadable code does not mean using advanced features of the language/libraries to simplify something.&nbsp; I would certainly choose the #inject:into over that mess with temp variables all over.&nbsp; We shouldn't fear to use the power of our language.<br><br /><hr />Local listings, incredible imagery, and driving directions - all in one place! <a href='http://maps.live.com/?wip=69&FORM=MGAC01' target='_new'>Find it!</a></body>
</html>