I want to express the belong relation between things, but not use of or 's such as "path of file" or "file's path".

In coding, there is sometimes a need to express "belong" relation in an identifier or function name. Apostrophe (') is an invalid character for this purpose. Too many words will make the identifier ugly, such as path_of_file.

What good expression can I use to express it in two words?

Is there a better answer than, for example, files_path?

  • Note that naming of terms is off topic here. Though filepath itself is a known word to use. You may want to make sure it's not a reserved word for your environment. – SrJoven Nov 7 '14 at 13:57
  • Can you give us more examples? – Always Asking Nov 7 '14 at 15:04
  • @AlwaysAsking I'm Sorry for I can't find a appropriate example timely.If I find some example,I will comment here again. – aprilgentle Nov 9 '14 at 13:02
  • @SrJoven As you say, the naming of terms is off topic here.What I want to know is whether there is another form to indicate the possessive.Do you think the meaning of file's path is the same as the meaning of file path? – aprilgentle Nov 9 '14 at 13:06
  • @SrJoven Thank you for correcting my grammar error. – aprilgentle Nov 9 '14 at 13:08

If you can't use an apostrophe to indicate the possessive, then I think you have to use "of". I can't think of any other construction that would work. And while this may be more appropriate for StackOverflow than ELU, I wouldn't worry about usage such as path_of_file being "ugly". Code is one area where clarity wins over beauty every time.

  • thank you for your reply.I'll ask the question for StackOverflow again. – aprilgentle Nov 7 '14 at 7:29
  • If you ask on SO, it will probably be closed as mostly opinion-based. Variable naming is based on personal style, there are no rules. – Barmar Nov 9 '14 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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