DEV Community

Discussion on: Writing Good Method & Variable Names

Collapse
 
shubhamforu profile image
Shubham

Great article. Curious about one thing. Have one another question. For example : getUserNearestLocation(user) by going through it we can say it this function is going to return user location based on user information. If suppose if I have to add another parameter in function let's say hospital getUserNearestLocation(user,hospital) now context has change name should be getUserNearestHospitalLocation . My question is that if tomorrow I have 10 parameters. Then this function name might be very big if I keep adding parameter. Eventually function is return userLocation based on parameter. In those cases what are good naming convention?