3 ms·
I've been working with rails for a long time, so it doesn't feel like magic to me, but I can understand that concern. I highly discourage metaprogramming unless
by mrinterweb 3y ago
I've been working with rails for a long time, so it doesn't feel like magic to me, but I can understand that concern. I highly discourage metaprogramming unless there is an obvious win. Rails/Ruby, especially in the beginning really leaned in hard on metaprogramming, but I've seen that be less of a trend with ruby. From my perspective, the metaprogramming trend has been going down. Ruby makes writing DSLs easy, and that can appear as magical too. In general, if a rails project follows convention it is easy to find what you're looking for.
I don't understand what you mean the global namespacing. Ruby has namespacing, and adding to the global namespace should be avoided except for adding new class definitions. Maybe you're referring to inheritance, and how much stuff can sneak into the current scope from class inheritance.
- dalyons 3y agoI’m guessing they mean the lack of manual import/use statements. Tends to annoy folk coming from other languages
- tenacious_tuna 3y agoYeah, our rails codebase by default has everything in the global namespace. It's possible to add namespacing with modules, which we do all over the place, but it took some getting used to for me to learn that everything was automatically "available" without any import statements anywhere. While convenient, it's made it very hard for me to reason about each module's dependencies and interconnections to other bits of the code.