|
95 | 95 |
|
96 | 96 | * Put business rules, long expressions, if statements, math formulas, metadata, etc. in only one place.
|
97 | 97 | * Identify the single, definitive source of every piece of knowledge used in your system, and then use that source to generate applicable instances of that knowledge (code, documentation, tests, etc).
|
98 |
| -* Apply the [Rule of three](http://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)) |
| 98 | +* Apply the [Rule of three](http://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)). |
99 | 99 |
|
100 | 100 | Resources
|
101 | 101 |
|
|
122 | 122 | * Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.
|
123 | 123 | * Always code and comment in such a way that if someone a few notches junior picks up the code, they will take pleasure in reading and learning from it.
|
124 | 124 | * [Don't make me think](http://www.sensible.com/dmmt.html).
|
125 |
| -* Use the [PLA](http://en.wikipedia.org/wiki/Principle_of_least_astonishment) (Principle of Least Astonishment). |
| 125 | +* Use the [Principle of Least Astonishment](http://en.wikipedia.org/wiki/Principle_of_least_astonishment). |
126 | 126 |
|
127 | 127 | Resources
|
128 | 128 |
|
|
166 | 166 |
|
167 | 167 | * Eliminate, minimise, and reduce complexity of necessary relationships.
|
168 | 168 | * By hiding implementation details, coupling is reduced.
|
169 |
| -* Apply the Law of Demeter. |
| 169 | +* Apply the [Law of Demeter](#law-of-demeter). |
170 | 170 |
|
171 | 171 | Resources
|
172 | 172 |
|
|
184 | 184 |
|
185 | 185 | How
|
186 | 186 |
|
187 |
| -* A method of an object may only call methods of: |
| 187 | +A method of an object may only call methods of: |
| 188 | + |
188 | 189 | 1. The object itself.
|
189 | 190 | 1. An argument of the method.
|
190 | 191 | 1. Any object created within the method.
|
@@ -215,12 +216,11 @@ Resources
|
215 | 216 |
|
216 | 217 | > The basic idea of orthogonality is that things that are not related conceptually should not be related in the system.
|
217 | 218 |
|
218 |
| -> It is associated with simplicity; the more orthogonal the design, the fewer exceptions. This makes it easier to learn, read and write programs in a programming language. The meaning of an orthogonal feature is independent of context; the key parameters are symmetry and consistency. |
| 219 | +Source: [Be Orthogonal](http://www.artima.com/intv/dry3.html) |
219 | 220 |
|
220 |
| -Resources |
| 221 | +> It is associated with simplicity; the more orthogonal the design, the fewer exceptions. This makes it easier to learn, read and write programs in a programming language. The meaning of an orthogonal feature is independent of context; the key parameters are symmetry and consistency. |
221 | 222 |
|
222 |
| -* [Be Orthogonal](http://www.artima.com/intv/dry3.html) |
223 |
| -* [Orthogonality](http://en.wikipedia.org/wiki/Orthogonality_(programming)) |
| 223 | +Source: [Orthogonality](http://en.wikipedia.org/wiki/Orthogonality_(programming)) |
224 | 224 |
|
225 | 225 | ## Maximise Cohesion
|
226 | 226 |
|
|
282 | 282 |
|
283 | 283 | How
|
284 | 284 |
|
285 |
| -* Apply [Curly's Law](#Curly-s-Law) |
| 285 | +* Apply [Curly's Law](#Curly-s-Law). |
286 | 286 |
|
287 | 287 | Resources
|
288 | 288 |
|
|
0 commit comments