Hi, <br><br>In general negation can be confusing, but negations are not only syntactically. You can find negation in the semantic also, e.g.: variable names. <br><br>You can find yourself with a variable name which express a negation, e.g.: <b>abandoned</b> (I must admit this is not the majority of the cases) <br>
<br>In such situations, it's really convenient to have different combinations that allow you to write the code that reads better. Which read better between these? <br><br>abandoned not ifTrue: []<br>abandoned ifFalse: [] <br>
<br>Maybe what you will discover is that most of the time you use ifTrue... maybe you negate the variable or not... I think is not what you like the most, but what you write most of the time that tent to be readable. <br>
<br>Regards, <br>Erlis <br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 9:20 AM, Louis LaBrunda <span dir="ltr"><<a href="mailto:Lou@keystone-software.com">Lou@keystone-software.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Guys,<br>
<div><div></div><div class="h5"><br>
>On 18.10.2011, at 05:11, Chris Muller wrote:<br>
><br>
>> (From vm-dev list)<br>
>>> But I much prefer foo ~~ bar ifTrue: than foo == bar ifFalse:.<br>
>><br>
>> Hi Eliot. May I ask why you prefer the former over the latter?<br>
>><br>
>> I'm interested because I'm working on an application where the folks<br>
>> involved prefer something similar, to where they write (expr) not<br>
>> ifTrue: [ ] rather than (expr) ifFalse: [ ].<br>
>><br>
>> I know you wouldn't do that but your statement definitely piqued my<br>
>> surprise and curiosity.<br>
><br>
>Maybe this is a clue: very few other programming languages have an "else"-case without a preceding "if true". So maybe for people versed in multiple languages the ifFalse: feels wrong?<br>
><br>
>I personally like "expr ifFalse:" better than "expr not ifTrue:". And I read "~~" as "not identical" which also has a mental "not" in it, so I prefer "== ifFalse" :)<br>
>- Bert -<br>
<br>
</div></div>Allow me to throw out an outside the box (programming box) thought. If one<br>
is able to mentally read "x ~= y ifTrue:..." or "x == y ifFalse:..." all in<br>
one look, I don't think it matters much as they know what the sentence says<br>
instantly. It then becomes a matter of what they are use to.<br>
<br>
For those of us who read those sentences in two parts: "x ~= y" and<br>
"ifTrue:...", the "not" being included in the comparison is preferred as it<br>
tells us up front what the comparison is about. Then the second part tells<br>
us what is being done about it. I hope helps and makes some sense.<br>
<br>
Lou<br>
-----------------------------------------------------------<br>
<font color="#888888">Louis LaBrunda<br>
Keystone Software Corp.<br>
SkypeMe callto://PhotonDemon<br>
mailto:<a href="mailto:Lou@Keystone-Software.com">Lou@Keystone-Software.com</a> <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
<br>
<br>
</font></blockquote></div><br>