>>1
not only it is ok, it's the right way to do it. Anything else is wrong.
Not only that, but suppose you want to return something like
if (a == 3) return 'a';
else return 'b';
it's not the proper way to do it. The proper way is to use the ternary operator, ?:, like this
return a == 3 ? 'a' : 'b';
the same goes for stuff like
if (a == 3) then val = 4;
else val = 10;
you better write
val = (a == 3 ? 4 : 10);
the same goes if you have something like
if (a == 3)
f(a,b,c,d,e,f);
else
f(a,b,c,d,e,g);
just write
f(a,b,c,d,e, a == 3 ? f : g);
it's cleaner, believe me.