|
1 | 1 | # Guidelines for Writing Guidelines
|
2 | 2 |
|
3 |
| -## 🙏 Use this document as a guide |
| 3 | +## Use this document as a guide |
4 | 4 |
|
5 | 5 | This document is not only a set of guidelines, but also a template for other guidelines documents.
|
6 | 6 |
|
7 |
| -## 🙏 Communicate the importance of your guideline |
8 |
| - |
9 |
| -Guidelines may differ in how closely they are intended to be followed. To designate the importance of a guideline, include an emoji in its header to assign it to one of three categories: |
10 |
| - |
11 |
| -1. **🙏 (Standard):** These are guidelines that it really behooves everyone to follow. There shouldn't be a reason not to follow them, but anyone who feels that a guideline should be changed or removed should start a discussion in a pull request. |
12 |
| -2. **🌳 (Recommended):** These are guidelines that everyone ought to follow, though teams or projects may opt to bypass or change them if they have a good reason to do so. |
13 |
| -3. **💡 (Suggested):** These are guidelines that offer one way to solve a problem among multiple, equally valid alternatives. When you are writing such a guideline, enumerate these alternatives and suggest one of them for the reader to follow. |
14 |
| - |
15 |
| -## 🙏 Be direct |
| 7 | +## Be direct |
16 | 8 |
|
17 | 9 | Guidelines should be as easy to understand and follow as possible. Think of each guideline like a commit: start with a concise summary, preferably a direct command, then use a paragraph or two to elaborate.
|
18 | 10 |
|
19 |
| -## 🙏 Be succinct |
20 |
| - |
21 |
| -Remove extraneous language in both the guideline itself and the elaboration (see [*The Elements of Style*](https://www.gutenberg.org/files/37134/37134-h/37134-h.htm#Rule_13) for help). |
| 11 | +## Be succinct |
22 | 12 |
|
23 |
| -## 🙏 Bolster your guideline if necessary |
| 13 | +Remove extraneous language in both the guideline itself and the elaboration. |
24 | 14 |
|
25 |
| -If a discussion exists in Slack or GitHub which spawned your guideline, link to that discussion. Or, if a book, blog post, or related work exists which can help to shine light on your guideline's utility, link to the resource. |
| 15 | +## Bolster your guideline if necessary |
26 | 16 |
|
27 |
| -Although not strictly necessary for arbitrary guidelines (which aim to solve problems with multiple, equal-advantage solutions) or for axiomatic guidelines (which abide by values assumed to be good over those assumed to be bad), including a context or rationale with your guideline is still helpful for onboarding. |
| 17 | +If a discussion exists in a public GitHub repository which provides context around a guideline, link to that discussion. Or, if a book, blog post, or related work exists which helps to explain the purpose of a guideline, link to the resource. |
28 | 18 |
|
29 |
| -Here is an example: |
| 19 | +Use a "Read more" section to collect multiple resources: |
30 | 20 |
|
31 | 21 | ``` markdown
|
32 |
| -## Use snake-case to name files and directories. |
| 22 | +### Read more |
33 | 23 |
|
34 |
| -[**View discussion on GitHub**](https://example.com). |
| 24 | +- [Link 1](https://example1.com) |
| 25 | +- [Link 2](https://example2.com) |
| 26 | +- [Link 3](https://example3.com) |
35 | 27 | ```
|
36 | 28 |
|
37 |
| -## 🙏 Provide examples |
| 29 | +## Provide examples |
38 | 30 |
|
39 |
| -It is far easier to understand a principle not by reading about it, but by observing its effects. |
| 31 | +It is far easier to understand the purpose and effects of a guideline not by reading about it, but by observing an example. |
40 | 32 |
|
41 |
| -A common way to provide an example is to offer a dichotomy: a passage of code which does not follow the guideline followed by a passage of code that does. Understanding that some decisions are arbitary, take care not to use language like "bad" or "good" which could be misread by others as a slight against them. Rather than assigning a grade to the code in question, tell the reader what to do. |
| 33 | +A common way to provide an example is to offer a dichotomy, a passage of code which falls outside the guideline followed by a passage of code that conforms to it. Understanding that some decisions are arbitrary, take care not to use language like "bad"/"good", "incorrect"/"correct", etc., which may sound judgmental. Rather than assigning a grade to the code in question, use emoji: |
42 | 34 |
|
43 |
| -For instance, instead of this: |
| 35 | + 🚫 |
44 | 36 |
|
45 |
| -~~~ markdown |
46 |
| -**Bad:** |
| 37 | + ``` javascript |
| 38 | + const x = 42; |
| 39 | + ``` |
47 | 40 |
|
48 |
| -``` javascript |
49 |
| -const x = 42; |
50 |
| -``` |
51 |
| - |
52 |
| -**Good:** |
| 41 | + ✅ |
53 | 42 |
|
54 |
| -``` javascript |
55 |
| -const THE_MEANING_OF_LIFE = 42; |
56 |
| -``` |
57 |
| -~~~ |
| 43 | + ``` javascript |
| 44 | + const THE_MEANING_OF_LIFE = 42; |
| 45 | + ``` |
58 | 46 |
|
59 |
| -say something like this: |
60 |
| - |
61 |
| -~~~ markdown |
62 |
| -Instead of this: |
63 |
| - |
64 |
| -``` javascript |
65 |
| -const x = 42; |
66 |
| -``` |
67 |
| - |
68 |
| -say this: |
69 |
| - |
70 |
| -``` javascript |
71 |
| -const THE_MEANING_OF_LIFE = 42; |
72 |
| -``` |
73 |
| -~~~ |
| 47 | +## Mark guidelines with options accordingly |
74 | 48 |
|
75 |
| -## 🙏 Be empowered to propose your ideas/suggestions |
| 49 | +By default, a guideline is intended to be followed unless there is a good reason not to do so. |
76 | 50 |
|
77 |
| -The guidelines in this repository are not set in stone, and none of us is the gatekeeper. If you disagree with a guideline, or you notice a guideline that's missing, feel free to open a discussion in a pull request. |
| 51 | +Occasionally, however, a guideline may offer a set of options among which the reader may choose. To designate this type of guideline, prefix the header with 💡. |
0 commit comments