3 ms·
Doesn’t pattern matching lead to either more verbose code or a duplicate code? Most of the time?
by jaequery 7y ago
Doesn’t pattern matching lead to either more verbose code or a duplicate code? Most of the time?
- hdra 7y agoIt could, when its used "wrong", though thats usually a result of trying to fit pattern matching where there are other more idiomatically way to express a code. I wouldn't say "most of the the time", its more of a common beginner's mistake. Pattern matching allows you to express the code in a more declarative way, and usually would result in a more succinct code.