3 ms·
> The words 'and' and 'or' should not be used for boolean comparisons, they are intended to be used to join two separate clauses such as "render 'template' and
by SnacksOnAPlane 13y ago
> The words 'and' and 'or' should not be used for boolean comparisons, they are intended to be used to join two separate clauses such as "render 'template' and return" in rails.
Is that true? Because I found a bug in our code recently that was in a line like
render_error and return
where the return was never getting called because render_error returned false. I don't understand why you would write code like that when you could simply write:
render_error
return
and not have to deal with thinking about whether render_error could ever return a falsey value.