|
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation. Reasons for using a naming convention (as opposed to allowing programmers to choose any character sequence) include the following: * to reduce the effort needed to read and understand source code;〔Derek M. Jones ("Operand names influence operator precedence decisions" ) An experiment investigating the effect of variable names on operator precedence selection〕 * to enable code reviews to focus on more important issues than arguing over syntax and naming standards. * to enable code quality review tools to focus their reporting mainly on significant issues other than syntax and style preferences. * to enhance source code appearance (for example, by disallowing overly long names or unclear abbreviations). The choice of naming conventions can be an enormously controversial issue, with partisans of each holding theirs to be the best and others to be inferior. Colloquially, this is said to be a matter of dogma. Many companies have also established their own set of conventions to best meet their interests. ==Potential benefits== Some of the potential benefits that can be obtained by adopting a naming convention include the following: * to provide additional information (i.e., metadata) about the use to which an identifier is put; * to help formalize expectations and promote consistency within a development team; * to enable the use of automated refactoring or search and replace tools with minimal potential for error; * to enhance clarity in cases of potential ambiguity; * to enhance the aesthetic and professional appearance of work product (for example, by disallowing overly long names, comical or "cute" names, or abbreviations); * to help avoid "naming collisions" that might occur when the work product of different organizations is combined (see also: namespaces); * to provide meaningful data to be used in project handovers which require submission of program source code and all relevant documentation * to provide better understanding in case of code reuse after a long interval of time. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Naming convention (programming)」の詳細全文を読む スポンサード リンク
|