I can not see the advantage of this coding practice. The project I'm working with now is full of these statements so it is not a single mistake.
Another example:
return getNumberOfBooks() > 5 ? true : false;
And another:
return isRed() ? true : false;
There is absolutely no reason to do this.
It is redundant and makes the code harder to read.
The following are far easier to read:
return ( getNumberOfBooks() > 5 ); return isRed();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With