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
Copy file name to clipboardExpand all lines: _posts/2019-01-25-simple-code.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ tags : software
8
8
9
9
> I want to write _simple_ code.
10
10
11
-
I've found this deceptively straight-forward phrase to have a very contextual meaning.
11
+
I've found this deceptively straight-forward phrase to have very contextual meaning.
12
12
13
-
In order to make meaningful progress, you have to _get_ things *done*.
14
-
However, in order to increase the rate at which things _get_ done, you have to make *doing* easier.
13
+
To make meaningful progress, you have to _get_ things *done*.
14
+
However, to increase the rate at which things _get_ done, you have to make *doing* easier.
15
15
16
16
Perhaps it's not about writing simple code at all, but rather choosing the optimal level of abstraction.
17
17
@@ -35,7 +35,7 @@ You have to continuously manage it as constraints move in and out of view.
35
35
But what happens when folks disagree on what they consider optimal?
36
36
I've found there are usually two personalities in play, often operating with incomplete information.
37
37
38
-
In my opinion the best tool we have at our disposal is empathy.
38
+
In my opinion, the best tool we have at our disposal is empathy.
39
39
Try to remove your personal bias and look at the problem from opposing perspectives.
40
40
41
41
### The Pragmatic Lens
@@ -44,16 +44,16 @@ To the pragmatist, optimal code is code that doesn’t try to hide away any comp
44
44
They are after the simplest solution to the problem.
45
45
46
46
In isolation, this style is said to be able to be read and written in a very straightforward, low-effort manner.
47
-
Because it uses an agreedupon set of primitives, it’s often less intimidating to new team members since it requires less knowledge of existing abstraction.
47
+
Because it uses an agreed-upon set of primitives, it’s often less intimidating to new team members since it requires less knowledge of existing abstraction.
48
48
49
-
The pragmatist is motivated by an uncertainty of future events.
49
+
The pragmatist is motivated by the uncertainty of future events.
50
50
Abstraction based on conjecture will be unnecessary and/or insufficient, resulting in more complexity as the system grows.
51
51
52
52
The benefit rightfully touted by the seasoned pragmatist is the possibility of arriving at the same (or better) abstraction through repetition.
53
-
In addition, the pragmatist keeps the option of withholding investment entirely, whilst still delivering initial value.
53
+
Also, the pragmatist keeps the option of withholding investment entirely, whilst still delivering initial value.
54
54
55
55
The cost identified by the idealist is that without abstraction, the system will have a lack of boundaries, resulting in having to keep large parts of the system on your mind when making changes.
56
-
In addition, if you continue to take debt, you further incentive yourself to defer paying it off.
56
+
Besides, if you continue to take debt, you further incentivize yourself to defer paying it off.
57
57
58
58
### The Idealistic Lens
59
59
@@ -67,7 +67,7 @@ As a result of this layering, we can now iterate on the abstraction as domain de
67
67
Rather than “simply” bolting on new functionality, we’re forced to confront how the new functionality fits into our existing understanding of the domain.
68
68
If done right, this can leave us with the tools to adapt as our domain is enriched.
69
69
70
-
The idealist is motivated by optimism of future events.
70
+
The idealist is motivated by the optimism of future events.
71
71
The abstraction we come up with will eventually yield returns far exceeding the initial investment.
72
72
73
73
The cost identified by the pragmatist is the creation of the abstraction in the first place.
@@ -77,13 +77,13 @@ And while it may be obvious what it claims to do, there tends to be a fear assoc
77
77
78
78
### Understand the Urgency
79
79
80
-
One way to increase your chances of making the wrong decision is by making the decision under pressure.
81
-
If you need something yesterday, it's probably not the best time to introduce an abstraction.
80
+
One way to increase your chances of making the wrong decision is by deciding under pressure.
81
+
If you need something yesterday, it's probably not the best time to introduce abstraction.
82
82
83
83
Add something that gets the job done to put your mind at ease so you can assess the situation without distraction.
84
84
If you can, do it with as few dependencies as possible to make removing it easier.
85
85
86
-
Make an effort to communicate this intentional decision and plan ahead to reassess.
86
+
Make an effort to communicate this intentional decision and plan to reassess.
87
87
88
88
### Determine the Uncertainty
89
89
@@ -98,7 +98,7 @@ If there's no matching concept in the system already, it's likely a good candida
98
98
99
99
There's a mental tax when folks have to map a concept to an unfit implementation of that concept.
100
100
If the wrong concept makes its way into the hive mind, it can fester into more unfit concepts that compound the mistake.
101
-
They to erradicate mistakes early.
101
+
Try to eradicate mistakes early.
102
102
103
103
Try to identify the axioms of your domain.
104
104
If you get those right, the effort to support a new composition of those axioms is more likely.
@@ -108,7 +108,7 @@ If experiments are common, can you optimize for them by isolating them alongside
108
108
109
109
### Involve Other People
110
110
111
-
One surefire way to torpedo the success of a decision, regardless of merit, is to make it in a vaccuum.
111
+
One sure-fire way to torpedo the success of a decision, regardless of merit, is to make it in a vacuum.
112
112
113
113
Know your audience.
114
114
You don't want to be the only one that understands how something works or why it works the way it does.
@@ -120,7 +120,7 @@ Group ownership and autonomy can be the difference between someone declaring tha
120
120
121
121
## Clarifying Our Intent
122
122
123
-
Our goal shouldn't be to just "write simple code", but to continously try to write code at the _optimal_ level of abstraction.
123
+
Our goal shouldn't be to just "write simple code", but to write code at the _optimal_ level of abstraction.
124
124
125
-
We can use urgency, uncertainty and other peoples' perspectives to help arrive at a reasonable decision.
125
+
We can use urgency, uncertainty, and other peoples' perspectives to help arrive at a reasonable decision.
126
126
As you learn more, the landscape changes -- expect to get it wrong and continuously re-evaluate.
0 commit comments