3 ms·
It isn't always that straightforward. For example: if (a) return (some && complicated || boolean && calculation); else return (some || other && boo
by zain 18y ago
It isn't always that straightforward. For example:
if (a)
return (some && complicated || boolean && calculation);
else
return (some || other && boolean || calculation);
edit: I suppose you can get rid of the "else", but you shouldn't have to sacrifice readability for a compiler shortcoming. I'm with mdasen; the compiler should figure it out.
- ralph 18y agoReadability is improved by not having the else clause. It makes it clear that the return in the then-block is there and the code won't continue after the end-if.