I've been naturally tending toward using more ternary operators and writing more branchless code over time. I find it generally elegant and compact. But it's true that it's a little less easy to debug step into or to set breakpoints for.
@wolfpld@ocornut Ternary operator might not produce branchless code, but you can make it branchless often without it (a common trick when manually writing SIMD code).
int f1(int a, int b, int c)
{
if(a>2137)
return a*b;
else
return c;
}
int f2(int a, int b, int c)
{
return a>2137 ? a*b : c;
}
int f3(int a, int b, int c)
{
int cnd = (a > 2137);
int ab = a*b;
return cnd * ab + !cnd * c;
}