Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've got method naming paralysis! Say I've got one class - "System", and another class "User".

Now, if I want to notify user(s), I can call:

// this method can notify individuals and collections of users
System.notify(User,message)

but if I want to simply notify the specific user

// this notifies the user
User.notify(message)

My dilemma is that in the case of "System" - the subject of the notify method is the User(s) argument. In the case of the "User" implementation, the User itself is the subject. So, the classes have the same method, arguably performing very similar jobs - but the "direction" of the methods are contrary.

Do you suffer from naming paralysis? How do you deal with it? What naming pattern would you use here?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You just need to use intention revealing names. For instance, System.send_notification, User.receive_notification.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.