Q: When is the proper time to use the ternary operator?

A: Any time!

I found this in a Java program I was updating at work:

boolean boolExcluded = obj.getString()
     .equalsIgnoreCase("yes") ? true : false;


Which is obviously redundant in this case. Geez.

0 comments on this foolish article: