官术网_书友最值得收藏!

Naming the program elements

Meaningful and descriptive element naming can greatly improve the source code's readability. It allows easy comprehension of the logical flow of the program. It is amazing how software developers still give names to program elements that are too short or not descriptive enough, such as giving a variable a letter name or using acronyms for variable naming. 

Generic or elusive names for elements lead to ambiguity. For example, having a method name as Extract() or Calculate() at first glance results in subjective interpretations. The same is applicable to using vague names for variables. For example:

int x2;

string xxya;

While program element naming in itself is an art, names are to be selected to define the purposes as well as succinctly describe the elements and ensure that the chosen names comply with the standards and rules of the programming language being used.

More information on acceptable naming guidelines and conventions is available at: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines.

主站蜘蛛池模板: 南澳县| 湘乡市| 岳阳市| 广州市| 龙门县| 武城县| 西乌珠穆沁旗| 格尔木市| 桃园市| 永德县| 临桂县| 克拉玛依市| 茂名市| 额尔古纳市| 民和| 泗阳县| 奉贤区| 大厂| 水富县| 鄂伦春自治旗| 伊宁县| 方山县| 吉水县| 余庆县| 迁西县| 丰县| 中牟县| 文昌市| 牟定县| 华蓥市| 航空| 淮南市| 新宁县| 奎屯市| 洛扎县| 冕宁县| 田东县| 资阳市| 神农架林区| 华亭县| 北川|