3 ms·
> to ruby. I also worry that it would make it too magical and difficult to figure out what code is running, where and when Coming from both python and statical
by mdaniel 3y ago
> to ruby. I also worry that it would make it too magical and difficult to figure out what code is running, where and when
Coming from both python and statically-typed languages, your description 100% squares up with every experience I've had with ruby
Folks are free to throw stones at the Spring Framework similarly, it's not out of bounds, but ruby seems to embrace the monkeypatch
- celdon25 3y ago> ruby seems to embrace the monkeypatch How recent were your experiences with this? In recent years I've seen monkeypatching treated as more of an antipattern. If you are on a project where people are doing that without very good reasons, that says more about the team than the language.
- aardvark179 3y agoIt is still prevalent enough that when developing Ruby JITs it can be worthwhile delaying compilation until the framework has started up and finished invalidating all your method lookups, or changing your invalidation strategy to handle new methods being defined on Object without invalidating all your inline caches.
- jbverschoor 3y agoI think that’s a misconception of people who don’t understand the underlying language/framework (yet). How much magic is really going on, especially compared to for example JPA/Hiberbate, or any of the aspect orient projects?
- kayodelycaon 3y agoMonkeypatching was common a decade ago. Now it’s more limited to things that try to be language or framework extensions, like ActiveSupport or gems extending ActiveRecord. The whole point of those is to deeply integrate. Metaprogramming like looping over an array to dynamic create methods is far less common. It definitely makes me cranky when I can’t find a method definition. ORMs are one of a few exceptions where the utility justifies it.