3 ms·
> It doesn’t matter where the expression is placed, it’s the same if you assign it to a variable If you separate the concern of the condition definition from
by 9wzYQbTYsAIc 5y ago
> It doesn’t matter where the expression is placed, it’s the same if you assign it to a variable
If you separate the concern of the condition definition from the conditional rendering, by pulling the conditional’s definition into a variable, you do get enhanced portability, though.
Much easier to port between languages and frameworks if your conditional definition can be copy-and-pasted out without having to mess with untwining the previous developers expression statements.
- eyelidlessness 5y agoI’m not sure whether I agree or disagree with this. But I do want to clarify that my intent was not to argue for or against conditional expressions in any code position, only to address the factual question of whether they constitute control flow.