3 ms·
I don't think either of those issues, namespaces and monkey patching, are things that make the language harder to learn. You require a file, the file's namespac
by jemmyw 3y ago
I don't think either of those issues, namespaces and monkey patching, are things that make the language harder to learn. You require a file, the file's namespaces are available. How often do libraries modify your runtime with monkey patches in a way that you'd notice? I'm sure it's come up during my career, but not when I was a beginner. There was a period of time when metaprogramming was more popular in the ruby and rails community but that was some time ago. Still, it's a tool that's nice to have available.
- hnfong 3y agoI vividly remember how I was told that you could write "2.years" in RoR. So, if you copy that code snippet and run it as an independent script, it would just not work because it was a RoR monkey patch method. Worse, the implicit imports mean that unless you have a global view of which files and gems are require-d, you don't know what your code is actually going to do. That, and coworkers suddenly feeling at liberty to override `method_missing`, abusing `bindings`, and all that stuff, makes it really hard to like the language if only for its tendency to bring out the worst in people.
- Daishiman 3y agoRequiring a file from a library that's part of a framework's source code can be quite challenging as it requires either the complete docs or perusing the source code to fully grok what's getting included, especially with the monkey patches. I don't know the current state of the RoR ecosystem but back then when both languages were competing for similar mindshare this was a massive turnoff.