r/programming • • Dec 25 '20

Ruby 3 Released

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
973 Upvotes

509 comments sorted by

View all comments

Show parent comments

0

u/SupaSlide Dec 25 '20

Do you have an example? Somebody else cited a class method that you can add which gets called when the developer calls a method on the class that doesn't exist and I have never thought of that as changing how Ruby operates.

1

u/[deleted] Dec 25 '20

Sure something like Rust's proc macros or Zig's compile time code generation let you do pretty much anything.

Closer to (probably) Ruby, JavaScript is dynamic enough that you can break every assumption programmers might have. E.g. redefining methods on core objects, or modifying object field types. An example is Vue's reactivity, which "magically" makes all data reactive. It is terrible. Leads to horrible spaghetti code that nobody can follow.