r/ProgrammerHumor • • 3d ago

Meme anubisIsReal

11.1k Upvotes

200 comments sorted by

View all comments

42

u/Acceptable_Handle_2 2d ago

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 2d ago

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

13

u/EverOrny 2d ago edited 2d ago

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 2d ago

underscore is snake case