Just a quick question, on standard style. When is it OK to use a ternary operation as opposed to an if/else?
if (a>b){
do this
}
else{
do that
}
VS
(a>b) ? do this : do that
Is it just a matter of preference or are there rules for when you use one over the other? I am just learning, and nothing I've read spells anything out.
if (a>b){
do this
}
else{
do that
}
VS
(a>b) ? do this : do that
Is it just a matter of preference or are there rules for when you use one over the other? I am just learning, and nothing I've read spells anything out.