Re:Anti-If: The missing patterns (2016)
by hellofunk on Wednesday June 27, 2018 @03:06PM
(#17410863)
Whose comment are you responding to? It seems you agree with my comment about pattern matching and switch cases.
I must've misunderstood your comment. I thought you were saying these pattern matching rules were basically souped up if's. Elixir has pattern matching on function level but it's also heavily ingrained in the whole philosophy. It's quite the antithesis to Java.
Re:Anti-If: The missing patterns (2016)
by your-nanny on Thursday June 28, 2018 @12:32AM
(#17414084)
The don't care _ is doing a lot of work keeping that code less verbose.
A Swift-enum allows you to have methods inside enums:
Then somewhere inside your code: The amount of if's that have to be juggled to do the same and the resulting code that is hard to parse when you're maintaining it definitely is more problematic.