I'm working with a team of non-native English speakers and I'm struggling to come up with a rule that explains why a method should be called
getFilePath and not
Examples of this bad naming come up on a daily basis and except for just pointing out the better name, I cannot figure out a good way to explain why words should be in a specific order, except for "It how it's written in English". Especially for variable names like this one since none of its components are adjectives.
I realize this is very basic and probably second nature to everyone here, but I think that's why I'm struggling to figure out how to explain it to people who don't understand it.
How would you explain it?
getFilePathis just a contraction of "get file's path". In other languages, it would be expressed in the form "get path of file". That's why expressing it as
getPathFilemakes sense to folk who do not have English as their first language. But in English it reads as "get path's file" which is the wrong way around.