Earlier quoted context omitted.
This reminds me of this one, which is quite common: return foo == null ? true : false;
I did something of this kind recently and it was to enforce more of an api in my object, like internally I call some low api method that either gives me the object I'm looking for or false / null when doesn't find it, but in my interface I don't want to leak that object, just true or false. So function isAvailable(){ objInDb = findByName('Joan Carlos'); // the object or false return objInDb ? true : false; } But all…
Re: Shit programmers write
#81I this case, returning objInDb would be semantically different. So, if you always want to return a Boolean, you did the right thing.