开发者

Variable naming conventions with respect to their contents [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved a开发者_C百科nd possibly reopened, visit the help center for guidance. Closed 11 years ago.

I understand there's gazillions of questions pertaining to conventions. I couldn't find much, however, regarding some specifics that have always plagued me in my coding.

It comes down to filesystem and device representations, whether a handle/resource or path; what conventions are often followed to appropriately name variables containing such values/data?

More specifically I mean:

  • /path/to/resource/ A directory path ($dirpath)

  • (handle) A file handle/resource ($filehandle)

  • filename.php A file name ($filename)

  • /path/to/resource/filename.php A file path ($filepath)

If any of these are incorrect, please advise; concern over this may seem asinine, however I want to secure the understanding for myself, not to mention future colleagues.

Any directions to references/complete lists, or suggestions from your personal experience are more than welcome.

(marked it as PHP in case there are any language specific conventions I should know)


You're using pretty standard variable names there, so I don't think any php programmer would mistake those for something else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜