You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function between<T>(value:T, left:T, right:T):boolean {
69
69
returnleft<=value&&value<=right;
70
70
}
71
71
```
72
72
73
-
**[⬆ back to top](#table-of-contents)**
73
+
**[⬆ back to top](#содержание)**
74
74
75
-
### Use pronounceable variable names
75
+
### Используйте произносительные имена переменных
76
76
77
-
If you can’t pronounce it, you can’t discuss it without sounding like an idiot.
77
+
Если вы не можете произносить их, вы не можете обсуждать их не выглядя как идиот.
78
78
79
-
**Bad:**
79
+
**Плохо:**
80
80
81
81
```ts
82
82
typeDtaRcrd102= {
@@ -86,7 +86,7 @@ type DtaRcrd102 = {
86
86
}
87
87
```
88
88
89
-
**Good:**
89
+
**Хорошо:**
90
90
91
91
```ts
92
92
typeCustomer= {
@@ -96,38 +96,42 @@ type Customer = {
96
96
}
97
97
```
98
98
99
-
**[⬆ back to top](#table-of-contents)**
99
+
**[⬆ back to top](#содержание)**
100
100
101
-
### Use the same vocabulary for the same type of variable
101
+
### Используйте один и тот же словарь для одних и тех же типов переменных
102
102
103
-
**Bad:**
103
+
**Плохо:**
104
104
105
105
```ts
106
106
function getUserInfo():User;
107
107
function getUserDetails():User;
108
108
function getUserData():User;
109
109
```
110
110
111
-
**Good:**
111
+
**Хорошо:**
112
112
113
113
```ts
114
114
function getUser():User;
115
115
```
116
116
117
-
**[⬆ back to top](#table-of-contents)**
117
+
**[⬆ back to top](#содержание)**
118
118
119
-
### Use searchable names
119
+
### Используйте имена, доступные для поиска
120
120
121
-
We will read more code than we will ever write. It's important that the code we do write is readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable. Tools like [TSLint](https://palantir.github.io/tslint/rules/no-magic-numbers/) can help identify unnamed constants.
121
+
Мы читаем больще кода, чем пишем. Это важно чтобы код, который мы пишем, был читаемым и достумным для поиска.
122
+
Не называйте переменные, которые в конечном итое имеют смысл только для наших программ мы вредим нашим читателям.
123
+
Делайте ваши имена доступными для поиска.
124
+
Такие инструменты, как [TSLint](https://palantir.github.io/tslint/rules/no-magic-numbers/) и [ESLint](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md)
125
+
могут помочь идентифицировать не названные константы.
0 commit comments