I’m having hard time deciding which name to choose for my method. I think they both are pretty much self-explanatory, but the latter is faster to type, so, my current preference is supportedModes(). What do you think?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To me,
getSupportedModesimplies simple retrieval, whereas if there is some actual logic involved to work them out, something likedetermineSupportedModesorcalculateSupportedModesmay be better. The name should describe what the function does. Brevity is not a major consideration with modern IDEs with some form of autocomplete.Different languages also have their own conventions. For example, a function called
calculateSupportedModesin Java would normally be calledCalculateSupportedModesin C# or VB.