[ruby-talk:444635] Ruby Mixins vs Rails Concerns

It is amazing how cryptic, difficult to reason about, and expensive to maintain Ruby codebases become when they include countless 'concerns' without honoring the Ruby naming convention for mixins as representing "traits"... Continue reading blog post: https://andymaleh.blogspot.com/2025/03/ruby-mixins-vs-rails-concerns.html

It's quite concerning :) "Musbury", 16 Devonshire Road, Mill Hill, London, NW7 1LL Home: +44 (0) 208 346 6444 Mobile: +44 (0) 7751 879 908 On Fri, 7 Mar 2025, 19:06 Andy Maleh via ruby-talk, < ruby-talk@ml.ruby-lang.org> wrote:
It is amazing how cryptic, difficult to reason about, and expensive to maintain Ruby codebases become when they include countless 'concerns' without honoring the Ruby naming convention for mixins as representing "traits"...
Continue reading blog post: https://andymaleh.blogspot.com/2025/03/ruby-mixins-vs-rails-concerns.html ______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...

It's quite concerning :)
Hahaha. Good one! It is concerning indeed!!! Andy On Fri, Mar 7, 2025 at 2:46 PM Hemal Varambhia via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
It's quite concerning :)
"Musbury", 16 Devonshire Road, Mill Hill, London, NW7 1LL
Home: +44 (0) 208 346 6444 Mobile: +44 (0) 7751 879 908
On Fri, 7 Mar 2025, 19:06 Andy Maleh via ruby-talk, < ruby-talk@ml.ruby-lang.org> wrote:
It is amazing how cryptic, difficult to reason about, and expensive to maintain Ruby codebases become when they include countless 'concerns' without honoring the Ruby naming convention for mixins as representing "traits"...
Continue reading blog post: https://andymaleh.blogspot.com/2025/03/ruby-mixins-vs-rails-concerns.html ______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...

I have always thought that the word "concern" was not necessary, I personally use the word "module", and only use "concern" in contexts in which people around expect that word. We do not fully agree that Ruby mixins are supposed to be "traits". A Ruby module is something way more generic than that in my view. In particular, splitting a class into chunks of related functionality for pure organizational purposes is for me a valid and idiomatic use case for modules. Additionally, let me leverage this message to underline that a "concern" is something conceptual and *does not* need to extend ActiveSupport:Concern. That module is a utility that simplifies certain patterns that you'd implement using included/extended in a simpler way. But if you don't need them, you don't need to use the utility.
participants (3)
-
Andy Maleh
-
Hemal Varambhia
-
Xavier Noria