DEV Community

Discussion on: We don't need a ternary operator

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

If...Else statements are flow though. I don't like using them in situations where I'm alternating between expression values. I let the high-level logic usually decide whether I want an if-else or a conditional-operator. If I use the wrong one it will look odd.

Collapse
 
bosepchuk profile image
Blaine Osepchuk

That's a fair point. In my code base, the previous programmers used them indiscriminately, which was part of the reason we're got rid of them. I've seen that pattern of usage in open source projects too.

If you used them consistently in the manor you've described, I could get on board with it.