Is anybody using the named boolean operators?

前端 未结 13 2215
南方客
南方客 2020-12-06 10:52

Or are we all sticking to our taught \"&&, ||, !\" way?

Any thoughts in why we should use one or the other?

I\'m just wondering because several answe

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 11:15

    In cases where I program with names directly mapped to the real world, I tend to use 'and' and 'or', for example:

    if(isMale or isBoy and age < 40){}
    

提交回复
热议问题