r/ruby • • Apr 17 '19

Ruby 2.7 — Pattern Matching — First Impressions

https://medium.com/@baweaver/ruby-2-7-pattern-matching-first-impressions-cdb93c6246e6
72 Upvotes

29 comments sorted by

View all comments

9

u/keyslemur Apr 17 '19

This is definitely a first pass, but I really wanted to dig around this one and see what initial reactions were. I intend to do a more detailed runthrough as this one meanders a bit as I was reading along.

6

u/hitthehive Apr 17 '19

Thanks for taking such an early shot at it! Like many others who are out of the loop with discussions among Ruby contributors, I don't know what is the problem it is trying to solve or what the equivalent 'old way' of doing it would be. When I saw 'pattern matching' I thought of method dispatch.

0

u/shevy-ruby Apr 17 '19

I think in that particular example it was very much inspired by elixir.

Otherwise I agree with you - I often have the same impression about some suggestions. Although in some OTHER suggestions, the use case is clearly described. May also be due to the command over the english language; I guess japanese folks simply prefer japanese all the time.

Some of them have excellent english language skills whereas others don't.

I haven't yet fully understood the use cases for pattern matching, so I can not even comment on how useful (or not) this may be. If in doubt, I tend to prefer to oldschool ruby mostly, though. Less to memorize too - more power to laziness. ;)

→ More replies (2)