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
This is a little repo to document my coding standards and styles for easy reference.
3
7
8
+
This is a little repo to document my coding standards and styles for easy reference.
4
9
5
10
## Indentation
11
+
6
12
Tabs
7
13
8
14
1 Tab = 4 spaces
9
15
10
16
## Curly brackets
17
+
11
18
Start curly brackets on if else blocks and functions should be on the same line as the declaration with a space before the curly bracket.
12
19
13
20
```js
@@ -19,6 +26,7 @@ function thing() {
19
26
```
20
27
21
28
## else
29
+
22
30
`elseif` and `else` blocks should be on a new line after the previous closing curly bracket
23
31
24
32
```js
@@ -30,8 +38,8 @@ else {
30
38
}
31
39
```
32
40
33
-
34
41
# Git Commits
42
+
35
43
I use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) with the extra commit types as [described in Angular](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type) and also some from the [Medium article - Conventional Commits: A Better Way ](https://medium.com/neudesic-innovation/conventional-commits-a-better-way-78d6785c2e08).
36
44
37
45
## Commit types
@@ -67,32 +75,31 @@ I use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) wit
67
75
## Abstraction
68
76
69
77
- Helps focus on the essential elements of an object, and hide less important details or mechanisms.
70
-
- Organises code more efficiently and extracts (*abstracts*) parts of the code into their own functions, methods, etc., using the DOT prinicple.
71
-
- Allows a program to not worry about the details of *how* an action is performed, but only *what* action is performed.
78
+
- Organises code more efficiently and extracts (_abstracts_) parts of the code into their own functions, methods, etc., using the DOT prinicple.
79
+
- Allows a program to not worry about the details of _how_ an action is performed, but only _what_ action is performed.
72
80
- A form of separation of concerns.
73
81
- Helps to construct more understandable code and promotes reusability.
74
82
75
83
## Inheritance
76
84
77
85
- Allows an object (child) to extend another object (parent).
78
-
- The child *inherits* all the properties and methods from the parent.
86
+
- The child _inherits_ all the properties and methods from the parent.
79
87
- Allows usage of the code from the parent.
80
88
- Enables the child to override methods and properties of the parent with it's own implementation.
81
89
- Promotes reusability and avoids duplication, meaning DRYer code.
82
90
83
91
## Polymorphism
84
92
85
93
- Extends inheritance, by allowing the parent object to become an `abstract` template object.
86
-
- Defines common methods for the child objects to *inherit* and use.
87
-
- Defines specific `abstract` methods that the child objects *must* implement.
94
+
- Defines common methods for the child objects to _inherit_ and use.
95
+
- Defines specific `abstract` methods that the child objects _must_ implement.
88
96
- Allows child objects of different types to perform the same method but with differing implementations.
89
97
- Promotes reusability and flexibility.
90
98
91
99
## Single Responsibility
92
100
93
101
- Extends on the DOT principle.
94
-
- A *single* file should define a *single* object.
95
-
- An object should have only a *single* responsibility - Do One Thing.
96
-
- An object should have a *single* reason to change.
102
+
- A _single_ file should define a _single_ object.
103
+
- An object should have only a _single_ responsibility - Do One Thing.
104
+
- An object should have a _single_ reason to change.
0 commit comments