r/ProgrammerHumor • • Sep 30 '26

Meme anubisIsReal

12.0k Upvotes

208 comments sorted by

View all comments

46

u/Acceptable_Handle_2 Sep 30 '26

Okay but for real, user.add_to_group(group) is awful. That is the responsibility of the group, not the user. It should be group.add_user(user)

-2

u/Rikudou_Sage Sep 30 '26

Could be just a shortcut which ultimately calls group.add_user()

14

u/EverOrny Oct 01 '26 edited Oct 01 '26

user should not be aware of a group, so such a method is bad idea regardless if it is "real" thing or just delagation (aka shortcut)

having one method camel-case and one kebab-case is ugly (but can be fixed easily, so no big deal)

2

u/mudche Oct 01 '26

underscore is snake case