<br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 1:58 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 18.10.2011, at 05:11, Chris Muller wrote:<br>
<br>
&gt; (From vm-dev list)<br>
&gt;&gt; But I much prefer foo ~~ bar ifTrue: than foo == bar ifFalse:.<br>
&gt;<br>
&gt; Hi Eliot.  May I ask why you prefer the former over the latter?<br>
&gt;<br>
&gt; I&#39;m interested because I&#39;m working on an application where the folks<br>
&gt; involved prefer something similar, to where they write (expr) not<br>
&gt; ifTrue: [ ] rather than (expr) ifFalse: [ ].<br>
&gt;<br>
&gt; I know you wouldn&#39;t do that but your statement definitely piqued my<br>
&gt; surprise and curiosity.<br>
<br>
</div></div>Maybe this is a clue: very few other programming languages have an &quot;else&quot;-case without a preceding &quot;if true&quot;. So maybe for people versed in multiple languages the ifFalse: feels wrong?<br>
</blockquote><div><br></div><div>For me, it&#39;s not about feeling right or wrong, it&#39;s about directly expressing intent. For example, in some loop where a predicate is being used to select or reject elements I would write &quot;obj predicate ifTrue:&quot; if I were looking for the element based on predicate and &quot;obj predicate ifFalse:&quot; if I were trying to filter-out elements based on predicate, just as I&#39;d write collection select: [:e| e predicate] to select items based on predicate and collection reject: [:e| e predicate] to filter them out, and I would /not/ write collection select: [:e| e predicate not] to filter them out unless performance was really really important (since reject: adds another block activation for each element).  I&#39;m trying to communicate whether I&#39;m selecting or rejecting based on predicate, and not wanting the reader to go through mental hoops by internally collapsing predicate not ifFalse: to predicate ifTrue: and vice verse.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I personally like &quot;expr ifFalse:&quot; better than &quot;expr not ifTrue:&quot;.</blockquote><div><br></div><div>Agreed.  expr not ifTrue: &amp; expr not ifFalse are perverse.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 And I read &quot;~~&quot; as &quot;not identical&quot; which also has a mental &quot;not&quot; in it, so I prefer &quot;== ifFalse&quot; :)<br></blockquote><div><br></div><div>Ah, there we differ.  I view == and ~~ as complementary predicates.  If I&#39;m writing foo == bar ifTrue: I&#39;m clearly selecting, and foo ~~ bar ifTrue: I&#39;m clearly rejecting, but foo == bar ifFalse: is IMO worse (more cognitively demanding) than foo ~~ bar ifTrue:.</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
- Bert -<br>
<br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>