Why do some people shun `if`?
Sat Aug 14 23:44:58 CEST 2021
I once stumbled over someone's Erlang style guide,
they wanted no `if`.
It was not very well explained why,
and there was no obvious e-mail address,
or I wanted to first do
some thorough thinking about it.
Now I have no more than this:
Is if not merely "syntactic sugar" for
a fun/0 with guarded clauses?
Now_this_is = (fun If() when Guard_seq_1 -> Expr_seq_1
%% On and on and on
; If() when Guard_seq_N -> Expr_seq_N
Worst = case true
of true when Guard_seq_1 -> Expr_seq_1
; true when Guard_seq_2 -> Expr_seq_2
What could be perceived as wrong with `if`?
But who will test the tests?
More information about the erlang-questions