[swift-users] true false vs yes no
bishal ghimire
bishal.ghimire at gmail.com
Sun Feb 14 00:43:38 CST 2016
Only thing that constantly reminds me that I am using Swift not Objective-C is YES/NO bool value.
Even after almost year of using Swift, I feel like Bool value should be Yes and No not true and false.
But as all other programming language follow true and false. I think its just matter of time before Objective-C developer get used to it.
> I found using"true/false" Boolean values reduced the code readability from the"YES/NO" of objective-c code.
>
> I'm wondering if others also consider"yes/no" to be simply better.
>
> A few reasons:
>
> Yes and no are much more common in every day English. Their concepts and meanings are well understood to everyone with little question.
>
> Concepts of truthfulness and falsehood have a great deal of philosophical/moral baggage associated with them and can be very subjective. They are not used regularly in every day English. Philosophers spend ages debating what is"truth", lawyers spend months arguing over who's truth to believe and theologians are ever searching for"a deeper truth".
>
> A code statement like isLightOn = yes makes perfect logical sense in English. isLightOn = true does not.
>
> Considering proposal SE-0005 point 5 is committing to using'is' bool variable names (e.g. isLightOn) should true/false be replaced with yes/no?
>
> I think it should.
>
>
>
More information about the swift-users
mailing list