Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C-sharp language specification.2004.pdf
Скачиваний:
14
Добавлен:
23.08.2013
Размер:
2.55 Mб
Скачать

Annex C Naming guidelines

1Annex C. Naming guidelines

2This annex is informative.

3One of the most important elements of predictability and discoverability is the use of a consistent naming

4pattern. Many of the common user questions don’t even arise once these conventions are understood and

5widely used. There are three elements to the naming guidelines:

61. Casing – use of the correct capitalization style

72. Mechanical – use nouns for classes, verbs for methods, etc.

83. Word choice – use consistent terms across class libraries.

9The following subclause lays out rules for the first two elements, and some philosophy for the third.

10C.1 Capitalization styles

11The following subclause describes different ways of capitalizing identifiers.

12C.1.1 Pascal casing

13This convention capitalizes the first character of each word. For example:

14

Color

BitConverter

 

 

 

 

15C.1.2 Camel casing

16This convention capitalizes the first character of each word except the first word. For example:

17

backgroundColor

totalValueCount

 

 

 

 

 

18C.1.3 All uppercase

19Only use all uppercase letters for an identifier if it contains an abbreviation. For example:

20System.IO

21System.WinForms.UI

22C.1.4 Capitalization summary

23The following table summarizes the capitalization style for the different kinds of identifiers:

24

463

Соседние файлы в предмете Электротехника