3 ms·
I really like rust's pattern matching and it's the feature I miss the most in other languages. However, I feel like its easy to encode too much control flow in
by froober 1y ago
I really like rust's pattern matching and it's the feature I miss the most in other languages. However, I feel like its easy to encode too much control flow in one match statement and make a garbled mess. The first example in the article uses all the features (destructuring, @ sigil, inline if, etc.) which I think makes it unreadable.
Overall good article, but those large match statements are difficult to read.
- Rendello 1y agoThe first pattern-matching language I used was Erlang. I generally like Rust's just as much, but Erlang/Elixir's binary-matching syntax was awesome and is sorely missed: https://learnyousomeerlang.com/starting-out-for-real#bit-syntax https://learnyousomeerlang.com/starting-out-for-real#bit-syn... https://lobste.rs/s/3a9e2a/matching_binary_patterns_with_erlang https://lobste.rs/s/3a9e2a/matching_binary_patterns_with_erl...