OLD | NEW |
---|---|
(Empty) | |
1 # Gender-neutral Chromium code | |
2 | |
3 ## Why this is important | |
4 | |
5 Some points in our code, documentation and comments contain needless assumptions | |
6 about the gender of a future reader, user, etc. __Example: "When the user logs | |
7 into his profile."__ | |
8 | |
9 Our [Code of Conduct](https://www.chromium.org/conduct) under "Be respectful and | |
10 constructive" says: | |
11 | |
12 > Each of us has the right to __enjoy our experience__ and participate without | |
13 > fear of harassment, __discrimination__, or __condescension__, whether blatant | |
14 > or subtle. | |
15 | |
16 Emphasis is added: unnecessarily gendered code is discriminatory and | |
17 condescending, and reading biased code isn’t enjoyable. | |
Matt Giuca
2017/03/28 02:55:33
nit: Curly apostrophes (throughout the file).
benwells
2017/03/28 03:14:06
oops, done.
| |
18 | |
19 ## Suggestions on how to keep code gender-neutral | |
20 | |
21 These are only suggestions. You make the call. | |
22 | |
23 Things to avoid: | |
24 | |
25 * Gendered pronouns: he / she / him / her / his / hers, etc. | |
26 * Instances of the phrases "he or she", "his/hers", "(s)he", etc. All of these | |
27 still exclude those who don’t identify with either gender, and implicitly | |
28 (slightly) favor one gender via listing it first. | |
29 * "Guys" as a gender-neutral term, which has male associations. Usually in | |
30 comments it implies anthropomorhism of inanimate objects and should be replaced | |
Matt Giuca
2017/03/28 02:55:33
s/morhism/morphism
benwells
2017/03/28 03:14:05
Done.
| |
31 with a more precise technical term. If it does refer to people, consider using | |
32 "everyone", "folks", "people", "peeps", "y’all", etc. | |
33 * Other gendered words: "brother", "mother", "man", etc. | |
34 | |
35 Cases that are likely fine to leave alone include: | |
36 | |
37 * References to a specific person ("Rachel is on leave; update this when she is | |
38 back."). | |
39 * A name ("Guy" and "He" are both valid names). | |
40 * A language code ("he" is the ISO 639-1 language code for Hebrew). | |
41 * He as an abbreviation for "helium". | |
42 * The Spanish word "he". | |
43 * References to a specific fictional person ([Alice, Bob, ...](http://en.wikiped ia.org/wiki/Alice_and_Bob)). | |
44 * For new code/comments, consider using just 'A', 'B' as names. | |
45 * Quotations and content of things like public-domain books. | |
46 * Partner agreements and legal documents we can no longer edit. | |
47 * Occurrences in randomly generated strings or base-64 encodings. | |
48 * Content in a language other than English unless you are fluent in that | |
49 language. | |
50 | |
51 How to change the remaining awkward intrusions of gender: | |
52 | |
53 * Try rewording things to not involve a pronoun at all. In many cases this makes | |
54 the documentation clearer. Example: "I tell him when I am all done." → "I tell | |
55 the owner when I am all done." This saves the reader a tiny bit of mental | |
56 pointer-dereferencing. | |
57 * Try using [singular they](https://en.wikipedia.org/wiki/Singular_they). | |
58 * Try making hypothetical people plural. "When the user is done he’ll | |
59 probably..." | |
60 → "When users complete this step, they probably...". | |
61 * When referring to a non-person, "it" or "one" may be good alternatives ([wikip edia link](http://wikipedia.org/wiki/Gender-specific_and_gender-neutral_pronouns #It_and_one_as_gender-neutral_pronouns)). | |
62 | |
63 ## Example changelists | |
64 | |
65 For a long list of changes, see [this bug](https://crbug.com/542537). Some | |
66 examples: | |
67 | |
68 * [Make some code gender neutral](https://crrev.com/e3496e19094cf7e711508fe69b19 7aa13725c790) | |
69 * [Updates comments in the src files to remove gender specific terms](https://cr rev.com/5b9d52e8a6ec9c11a675bae21c7d1b0448689fb6) | |
70 * [Gender-neutralize a few more comments / strings](https://crrev.com/993006d919 c7b0d3e2309041c1e45b8d7fc7ff0e) | |
71 * [Make some android code gender neutral](https://crrev.com/93d83ac96c3d1c27be9e a7e842b25b3dded2550b) | |
72 | |
73 ## Tools | |
74 | |
75 * [Here](https://cs.chromium.org/search/?q=%28%5E%7C%5Cs%7C%5C%28%7C%5C%5B%29%28 %5BHh%5De%7C%5BSs%5Dhe%7C%5BHh%5Dis%7C%5BHh%5Ders?%7C%5BHh%5Dim%7C%5BHh%5Der%7C% 5BGg%5Duys?%29%5Cb&sq=package:chromium&type=cs) | |
76 is a code search link prepopulated with a search that finds a lot of gendered | |
77 terms. | |
78 * To search for files containing gendered terms, use this command (or a variant | |
79 of it): | |
80 ``` | |
81 git grep -wiEIl \ '(he)|(she)|(his)|(hers)|(him)|(her)|(guy)|(guys)' | |
82 ``` | |
83 * To search in a file open in vim for gendered terms, use this command: | |
84 ``` | |
85 /\<he\>\|\<she\>\|\<his\>\|\<hers\>\|\<him\>\|\<her\>\|\<guy\>\|\<guys\>|\<man\> \c | |
86 ``` | |
87 * There are presubmit checks available for this that are run for the infra and | |
88 v8 repos. They are not run for other repos as there are too many false | |
89 positives. | |
90 | |
91 ## Thanks | |
92 | |
93 This document is based on an internal Google document by Rachel Grey and others, | |
94 which can be found [here](https://goto.google.com/gender-neutral-code) (sorry, | |
95 Googler only). | |
OLD | NEW |