Bug 18432 - Most code comments assume male gender
Summary: Most code comments assume male gender
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Developer documentation (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Eric Phetteplace
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 22716
  Show dependency treegraph
 
Reported: 2017-04-13 21:24 UTC by Eric Phetteplace
Modified: 2019-04-16 16:33 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: String patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
patch (16.97 KB, patch)
2017-04-13 21:31 UTC, Eric Phetteplace
Details | Diff | Splinter Review
new patch (17.25 KB, patch)
2017-04-14 20:07 UTC, Eric Phetteplace
Details | Diff | Splinter Review
Bug 18432: code comments assume male gender (17.28 KB, patch)
2017-04-14 21:51 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18432 : Follow up -Updating to use they/them and skipping the ones changed to it (15.72 KB, patch)
2017-04-18 21:39 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18432: code comments assume male gender (17.34 KB, patch)
2017-04-20 12:40 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18432 : Follow up - Updating to use they/them (15.70 KB, patch)
2017-04-20 12:40 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 18432: code comments assume male gender (17.40 KB, patch)
2017-04-20 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18432 : Follow up - Updating to use they/them (15.76 KB, patch)
2017-04-20 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18432: Replace 2 'he or she' with 'they' (1.26 KB, patch)
2017-04-20 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Phetteplace 2017-04-13 21:24:20 UTC
Throughout the Koha codebase, the pronoun "he" is used to refer to a generic third person who could be of any gender. For instance, in C4/Suggestions.pm line #66:

'When a librarian manages the suggestion, he can set the status to "REJECTED" or "ACCEPTED".'

That assumes all librarians are male. It's particularly problematic given that, in the US at least, the profession is heavily female. In other files, all borrowers are assumed to be male. In the interest of making the code base more inclusive, it'd be better to not assume a male gender.

The patch—which touches *a lot* of disparate files but almost only comments—changes all instances of "he" or "him" I could find to "he or she" and "him or her" respectively. I'd also be in support of singular "they"/"their" in these situations if people prefer that. In a few cases, a non-human object was being referred to as "he", so I used "it" instead.

FYI, the regex I used to find uses of the pronoun "he" and "him":

- / (H|h)e (?!or she)/
- / (H|h)im (?!or her)/

I ignored "docs/history.txt" and "misc/release_notes" since those seem to refer to actual men who worked on Koha, and also the Maori translations. There were 3 "unimarc_framework_DEFAULT.sql" files also used "he" in a way that seemed to refer to a particular individual, though I'm not sure.

Testing plan: 

- I can't really formulate a "testing plan" for this patch since it shouldn't impact actual executing code
- The patch does touch strings in a few tests so at the very least these should continue to pass:

 M C4/SIP/t/06patron_enable.t
 M koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
 M t/db_dependent/Circulation.t
 M t/db_dependent/Koha/Patrons.t
 M t/db_dependent/Reserves.t
Comment 1 Eric Phetteplace 2017-04-13 21:31:45 UTC
Created attachment 62155 [details] [review]
patch
Comment 2 Marcel de Rooy 2017-04-14 10:01:53 UTC
I am not sure if we should start changing all comments for this kind of trivial edits. I would better understand changing templates (what we actually see on the Koha interface). But you seem to touch scripts and modules only.
Comment 3 Eric Phetteplace 2017-04-14 16:38:23 UTC
I disagree that making code base gender inclusive is trivial. It discourages contributions from female developers. It's also just flat-out inaccurate, as in places where tests assume all juveniles are male (t/db_dependent/Koha/Patrons.t).

I searched over the templates as well and they tended to not have this problem, it's almost entirely in comments or strings printed during tests.
Comment 4 Marc Véron 2017-04-14 19:24:17 UTC
QA tools complain for one file:
FAIL	acqui/neworderempty.pl
   FAIL	  forbidden patterns
		forbidden pattern: tab char (line 157)

Question:
Why is the male form always at the first place ('he or she' / 'him or her')? Does that not introduce a new inequality?
Comment 5 Eric Phetteplace 2017-04-14 20:07:10 UTC
Created attachment 62182 [details] [review]
new patch
Comment 6 Eric Phetteplace 2017-04-14 20:08:45 UTC
Alphabetical order is one reason. As I said, I'd be happy to use singular "they/them" universally if people prefer that. I could also alternate orderings between "he or she" and "she or he".

New patch with whitespace changes added.
Comment 7 Marc Véron 2017-04-14 21:51:41 UTC
Created attachment 62184 [details] [review]
Bug 18432: code comments assume male gender

Comments throughout the Koha codebase assume that
all librarians or borrowers are male by using the
pronoun 'he' universally. This patch changes to
'he or she' / 'him or hers'.

Testing plan:

- ensuring modifying tests still pass:
	+ C4/SIP/t/06patron_enable.t
	+ t/db_dependent/Circulation.t
	+ t/db_dependent/Koha/Patrons.t
	+ t/db_dependent/Reserves.t

Sponsored-By: California College of the Arts

No code changes detected.
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 8 Jonathan Druart 2017-04-18 20:07:46 UTC
I guess you are going to expect this to be a new coding guideline?
In that case you should write a proposal and submit the topic to the next dev meeting.
I personally think that "he or she" is heavy to read.
Comment 9 Jonathan Druart 2017-04-18 20:08:37 UTC
The patch is already outdated

t/db_dependent/Koha/Patrons.t:    is( $total, $enrolmentfee_K + $enrolmentfee_J, "Kid growing and become a juvenile, he should pay " . ( $enrolmentfee_K + $enrolmentfee_J ) );
Comment 10 Chris Cormack 2017-04-18 20:49:26 UTC
I think this is a useful contribution, however I suggest we change the pronoun to they. It is non gendered and neutral
Comment 11 Eric Phetteplace 2017-04-18 20:57:27 UTC
I agree, "they" is better. More concise & more inclusive.

I will write a proposal to the koha-devel email list and try to make the next developer's meeting, though if I recall all the recent ones have been during my commute hour so I've never been able to attend. I assume once it's approved I am OK to add to the wiki page on coding guidelines and write a new patch that changes all instances of "he/him" and "he/him or she/her" to "they/them".
Comment 12 Chris Cormack 2017-04-18 21:12:00 UTC
(In reply to Eric Phetteplace from comment #11)
> I agree, "they" is better. More concise & more inclusive.
> 
> I will write a proposal to the koha-devel email list and try to make the
> next developer's meeting, though if I recall all the recent ones have been
> during my commute hour so I've never been able to attend. I assume once it's
> approved I am OK to add to the wiki page on coding guidelines and write a
> new patch that changes all instances of "he/him" and "he/him or she/her" to
> "they/them".

I'm currently just doing a follow up patch that changes the language, should be done soon, so you can have an example to show if you want. (I'll leave your original patch and do it as a follow up, so you still get credit for a commit)
Comment 13 Chris Cormack 2017-04-18 21:39:43 UTC
Created attachment 62336 [details] [review]
Bug 18432 : Follow up -Updating to use they/them and skipping the ones changed to it
Comment 14 Owen Leonard 2017-04-20 12:40:52 UTC
Created attachment 62467 [details] [review]
[SIGNED-OFF] Bug 18432: code comments assume male gender

Comments throughout the Koha codebase assume that
all librarians or borrowers are male by using the
pronoun 'he' universally. This patch changes to
'he or she' / 'him or hers'.

Testing plan:

- ensuring modifying tests still pass:
	+ C4/SIP/t/06patron_enable.t
	+ t/db_dependent/Circulation.t
	+ t/db_dependent/Koha/Patrons.t
	+ t/db_dependent/Reserves.t

Sponsored-By: California College of the Arts

No code changes detected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 15 Owen Leonard 2017-04-20 12:40:56 UTC
Created attachment 62468 [details] [review]
[SIGNED-OFF] Bug 18432 : Follow up - Updating to use they/them

Updating to use they/them and skipping the ones changed to it

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 16 Jonathan Druart 2017-04-20 16:00:42 UTC
Created attachment 62482 [details] [review]
Bug 18432: code comments assume male gender

Comments throughout the Koha codebase assume that
all librarians or borrowers are male by using the
pronoun 'he' universally. This patch changes to
'he or she' / 'him or hers'.

Testing plan:

- ensuring modifying tests still pass:
	+ C4/SIP/t/06patron_enable.t
	+ t/db_dependent/Circulation.t
	+ t/db_dependent/Koha/Patrons.t
	+ t/db_dependent/Reserves.t

Sponsored-By: California College of the Arts

No code changes detected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2017-04-20 16:00:47 UTC
Created attachment 62483 [details] [review]
Bug 18432 : Follow up - Updating to use they/them

Updating to use they/them and skipping the ones changed to it

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2017-04-20 16:00:52 UTC
Created attachment 62484 [details] [review]
Bug 18432: Replace 2 'he or she' with 'they'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Jonathan Druart 2017-04-20 16:25:15 UTC
Added a check to the QA tests:

  commit 953c8903f3d2dde89be05df6c4b0d8f671736886
  Do not assume male gender, use they/them instead (bug 18432)
Comment 20 Kyle M Hall 2017-04-21 14:57:13 UTC
Pushed to master for 17.05, thanks Eric, Chris, Jonathan!
Comment 21 Katrin Fischer 2017-04-21 23:01:04 UTC
Doesn't apply cleanly - please provide rebased patches for stable if you think it should be in 16.11.x.