I sometimes do that in PHP because I hate the equivalence between "", false, null, '0' and 0. Seeing true and false written out makes it more readable.
When you find your language forces you to do stupid things, the correct response is not "get in the habit of doing stupid things". It's "find a better language".
The result of "foo == null" (or better "foo === null") is boolean, I don't know what is the "equivalence" problem here.
Maybe this is a programmer who likes to spell things out for future readers. It's easier to convey meaning with return foo == null ? true : false;
Let's picture a future reader:
"Hmmm, if 'foo == null' is true, than it's true... I see..."
Seriously..
From a maintenance perspective, it's a bit more involved than that. Returning the explicit evaluation result says, "I do care what foo is and these are the only valid possible return values after expression evaluation, today just return null but in the future we might return something different, either way the return value at this point is critical and needs to be explicitly considered and processed".
Yeah, it was a wild guess. I have a habit of making things more verbose for future maintainers.
To a non programmer or an absolute beginner? Sure, but then I would ask; why in the hell are you writing your code in a style catered to people who don't know what they are doing? That line simply shows that the writer doesn't understand Boolean expressions.
would a comment not be more appropriate in such circumstances?