This is part of why I don't like ternaries. Even if the person writing the ternary knows exactly what they're doing, someone else reading the ternary isn't sure that the writer actually meant what they wrote.
I think I'm just so used to them these days that it never occurs to me that they're unclear to anyone but junior devs. I like the brevity.
Having said that, I always read them with a subvocalised question intonation, so it always sounds like a "Really? Yes : No" in my head, which is maybe what has helped the pattern seem "obvious" to me.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is part of why I don't like ternaries. Even if the person writing the ternary knows exactly what they're doing, someone else reading the ternary isn't sure that the writer actually meant what they wrote.
I think I'm just so used to them these days that it never occurs to me that they're unclear to anyone but junior devs. I like the brevity.
Having said that, I always read them with a subvocalised question intonation, so it always sounds like a "Really? Yes : No" in my head, which is maybe what has helped the pattern seem "obvious" to me.