In Erlang, you rarely see people using `if`. It's kind of considered bad style and 99% of the time `case` is used in its place - why? Well have a read: https://learnyousomeerlang.com/syntax-in-functions#what-the-if
Anyway, in Elixir of course the people coming from other languages want to use `if` all the time because that's what they are used to. As a former Erlang dev I never use `if` in Elixir.
Turns out in Elixir, `if` is actually a macro that uses `case` under the hood.
So you might as well just use case statements ;)