Skip to content

Commit 426c3d9

Browse files
fixes #56 - footnote explaining 3 space indent
1 parent 8232203 commit 426c3d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/3-coding-style/coding-style.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Rule | Description
88
:--: | -----------
99
1 | Keywords are written uppercase, names are written in lowercase.
10-
2 | 3 space indention.
10+
2 | 3 space indention[^2].
1111
3 | One command per line.
1212
4 | Keywords `LOOP`, `ELSE`, `ELSIF`, `END IF`, `WHEN` on a new line.
1313
5 | Commas in front of separated elements.
@@ -85,3 +85,13 @@ Check whether we passed a valid sql name
8585
</pre>
8686
*/
8787
```
88+
89+
[^2]:
90+
Tabs are not used because the indentation depends on the editor configuration.
91+
We want to ensure that the code looks the same, indepenent of the editor used.
92+
Hence, no tabs. But why not use 8 spaces? That's the traditional value for a tab.
93+
When writing a package function the code in the body has an indentation of 3.
94+
That's 24 characters as a starting point for the code. We think it's too much.
95+
Especially if we try to keep a line below 100 or 80 characters. Other good options
96+
would be 2 or 4 spaces. We settled for 3 spaces as a compromise.
97+
The indentation is still good visible, but does not use to much space.

0 commit comments

Comments
 (0)