<div dir="auto">I think this kind of style originated in languages like Perl, Lua and Javascript for writing shorthand code for default values. Things like "v = v or -1".<div dir="auto"><br></div><div dir="auto">From there things spread, leading to odd combinations, like the examples you quote with side effects.</div><div dir="auto"><br></div><div dir="auto">In the end it is about readability, sometimes the shortcut can read nicer than a case or if statement. And sometimes it is clearer to be a teensy bit more verbose.</div><div dir="auto"><br></div><div dir="auto">Robby</div><div dir="auto"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 Jul 2018 14:25, "Viktor Söderqvist" <<a href="mailto:viktor@zuiderkwast.se">viktor@zuiderkwast.se</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey everyone,<br>
<br>
I've seen these short-circuit operators with a non-boolean second<br>
operand, usually where the second operand is doing some side-effect and<br>
the return value is not important. It seems to be a trend. Example:<br>
<br>
    Msg /= undefined andalso io:format("Message: ~s~n", [Msg]),<br>
<br>
I this good or bad style?<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
</blockquote></div></div>