+ 4
This is goodđđ.
But this is only for one line if-else leader and it's easy to understand for only one line if-else leader.
If you require some more big if-else or if-elseif-else leader than you must be use the typical way.
+ 4
Whenever you see like:
if(...) someBoolVar = true;
or
return true;
you can be pretty certain it is a bad style. The expression "n % 2 != 0" is already boolean. You can assign directly:
isPrime = ( n % 2 != 0 );
[The parentheses are not necessary. It is a matter of style if you prefer to have them or not.]
+ 1
Welcome đđđ