To ternary or not to ternary? [closed]
Use it for simple expressions only: int a = (b > 10) ? c : d; Don’t chain or nest ternary operators as it hard to read and confusing: int a = b > 10 ? c < 20 ? 50 : 80 : e == 2 ? 4 : 8; Moreover, when using ternary … Read more