Hacker News new | past | comments | ask | show | jobs | submit login

Doesn’t pattern matching lead to either more verbose code or a duplicate code? Most of the time?



It 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: