[squeak-dev] ifTrue: vs. ifFalse:
frank.shearar at gmail.com
Tue Oct 18 10:52:12 UTC 2011
On 18 October 2011 09:58, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On 18.10.2011, at 05:11, Chris Muller wrote:
>> (From vm-dev list)
>>> But I much prefer foo ~~ bar ifTrue: than foo == bar ifFalse:.
>> Hi Eliot. May I ask why you prefer the former over the latter?
>> I'm interested because I'm working on an application where the folks
>> involved prefer something similar, to where they write (expr) not
>> ifTrue: [ ] rather than (expr) ifFalse: [ ].
>> I know you wouldn't do that but your statement definitely piqued my
>> surprise and curiosity.
> 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?
> 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" :)
Ruby and Common Lisp have "unless"... and I find I almost never use them.
More information about the Squeak-dev