@pyrmont IMO is not about smart people thinking is good or not. In my experience is more about why is worthy at some use case.
Perhaps a view from other languages as Rust give more ideas...
In rust the most used is for a powerful case dispatcher. But is not only that, can go beyond that. A clear advantage goes on a code with less if-else-elseif...
@pyrmont Now in Elixir:
Is also used for many cases, as head / tail (who needs recursion?) to a functions-acting-as-overloading, but powerful and with a lot of sense:
def zero?(0) do : true
def zero?(x) when is_integer(x): false
In the above code the invocation will be called with the code required, no `if` statements involved because we are using pattern matching.
>zero(0) # will call 1st def
>zero(10) # will call the 2nd
@pyrmont so, how this is good or bad? it depends. But most of the cases is a more clear design, and in some a way better way to solve problems involving flow of 'instant' dispatchers with a defined pattern.
A promised no-if-statments-needed coding style? maybe.
What do we have on #ruby? Since is not bundle on the language we have been developing modules and classes trying to implement this ideas.
Basic idea: Create a Result object, then match.
A Mastodon instance for Rubyists & friends