How to name variables

前端 未结 24 1348
抹茶落季
抹茶落季 2020-12-01 00:37
  • What rules do you use to name your variables?
  • Where are single letter vars allowed?
  • How much info do you put in the name?
  • How about for exam
24条回答
  •  孤街浪徒
    2020-12-01 01:20

    Since I work as a contractor, moving among different companies and projects, I prefer to avoid custom naming conventions. They make it more difficult for a new developer, or a maintenance developer, to become acquainted with (and follow) the standard being used.

    So, while one can find points in them to disagree with, I look to the official Microsoft Net guidelines for a consistent set of naming conventions.

    With some exceptions (Hungarian notation), I think consistent usage may be more useful than any arbitrary set of rules. That is, do it the same way every time.

    .

提交回复
热议问题