Apr-02-2017, 11:50 PM
(Apr-02-2017, 11:34 PM)wavic Wrote: The second way, isn't it deprecated?Deprecated usually means it was recommended at the time :)
It was an ok hack, but the behavior is not the same. When you build the list, its contents get evaluated, whereas with the longer form or the ternary expression it evaluates only what it needs to. This is important if there are side effects (aka EVIL) or even if there is a performance cost associated with one or both values.