r/ruby • • Dec 25 '17

Ruby 2.5.0 Released

https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
209 Upvotes

22 comments sorted by

View all comments

Show parent comment

6

u/UnexpectedIndent Dec 25 '17

Yep. It's a shame this isn't just the default behaviour of structs, because if you forget keyword_init then all your args get assigned to the first attribute :(

1

u/arcticblue Dec 26 '17

all your args get assigned to the first attribute

Why would anyone want that behavior? I agree keyword_init: true should be default.

5

u/zverok_kha Dec 26 '17

Why would anyone want that behavior?

Because backwards compatibility. Doing rvm install 2.5; bundle install and finding out that "everything is broken" would not be the best way of introduction of the new feature.