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
There is mandatory and recommended parts. _Recommended part to being formed at the moment_
2
+
This is the first approximation of COS guidelines we use for github.com/intersystems-ru projects. There are mandatory and recommended parts.
3
3
4
-
But here is general advice: use common sense and try to *be consistent* wherever you write code.
4
+
We do not plan to be too much restrictive, but rather flexible enough to allow many reasonable styles.
5
+
Here is the general advice: use common sense and try to *be consistent* wherever you write code.
5
6
If there is some style already established in the class or utility being modified then we recommend
6
7
to continue use that same style, than introducing yet another one, which may be more recommended
7
-
but will produce inconsistent results.
8
+
but which will be introducing some unnecessary inconsistency.
8
9
9
10
## Mandatory part
10
11
11
12
* Only "modern" syntax permitted, dotted syntax is not generally allowed (with few exceptions)
12
-
* No short name for statements keywords allowed - use fully expanded keyword names. This same rule applie to builtin function names - they should be fully pronounced.
13
+
* No short name for statements keywords or built-in functions allowed - use fully expanded names.
13
14
14
15
## Recommended part
15
-
* We recommend to use fully expanded keyword in lower case or capitalized. Whatever you'll select should be consistent across class or utility, i.e.
16
+
* We recommend to use fully expanded keyword or function name in lower case or capitalized. Whatever you'll select should be consistent across class or utility, i.e.
16
17
```
17
18
If (expression) {
18
19
Do ##class(Sample).%New(initexpresion)
19
20
For i=1:1:10 {
20
-
Write something, $Zversion, !
21
+
Write something, $ZVersion, !
21
22
}
22
23
}
23
24
```
@@ -31,16 +32,23 @@ If (expression) {
31
32
}
32
33
}
33
34
```
34
-
* Use the reasonable name convention which is consistent across hierarchy. We recommend to use CamelCase for classes, methods and properties (e.g. `Sample.Person`, `OpenFile`, `LastIndex`, etc.), but smallCamelCase for local variables (e.g. `startDate`, `endDate`), but please be consistent and use local schea if it's different thancurrent recommendation.
35
-
* For better readablity please insert spaces after comma in argument list, i.e.
36
-
```
37
-
Write 1, 2, 3
38
-
Do ..Method(Arg1, Arg2, Arg3)
39
-
```
35
+
* Use the reasonable name convention consistently across whole hierarchy. We recommend to use CamelCase for classes, methods and properties (e.g. `Sample.Person`, `OpenFile`, `LastIndex`, etc.), but smallCamelCase for local variables (e.g. `startDate`, `endDate`), but please be consistent and use local schema if it's different than current recommendation.
40
36
* We recommend to use `#dim` statement for declaration of local variables types, e.g.
41
37
```
42
38
#dim array as %ArrayOfDataTypes = ##class(%ArrayOfDataTypes).%New()
43
39
do array.SetAt(id, "id")
44
40
#dim status As %Status = $$$OK
45
41
```
46
42
This will help editor to provide better auto-complete, and eventually will be used by static checker for type informantion extraction.
43
+
* For better readablity please insert spaces after comma in argument list, i.e.
44
+
```
45
+
Write 1, 2, 3
46
+
Do ..Method(Arg1, Arg2, Arg3)
47
+
```
48
+
* For better readability please insert spaces around assignment. You may align several neighbour assignments according to your tastes, i.e.
0 commit comments