# Doing Terrible Things To Your Code

**URL:** <https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483>\
**Category:** blog\
**Created:** [July 30, 2015, 9:31am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483 "2015-07-30T09:31:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![codinghorror](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/codinghorror/32/36371_2.png) [@codinghorror](https://discourse.codinghorror.com/u/codinghorror)\
**Post date:** [July 30, 2015, 9:31am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/1 "2015-07-30T09:31:58Z")

</div>

In 1992, I thought [I was the best programmer in the world](http://blog.codinghorror.com/why-im-the-best-programmer-in-the-world/). In my defense, I had just graduated from college, this was pre-Internet, and I lived in Boulder, Colorado working in small business jobs where I was lucky to even _hear_ about other programmers much less meet them.

* * *
This is a companion discussion topic for the original entry at [http://blog.codinghorror.com/doing-terrible-things-to-your-code/](http://blog.codinghorror.com/doing-terrible-things-to-your-code/)

---

<div class="post-metadata">

**Author:** ![aebrain](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/aebrain/32/75517_2.png) [@aebrain](https://discourse.codinghorror.com/u/aebrain)\
**Post date:** [July 30, 2015, 11:14am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/2 "2015-07-30T11:14:33Z")

</div>

Regarding falsehoods about Gender…  
[Some humans naturally change sex](http://www.usrf.org/news/010308-guevedoces.html)

This can be an issue if the customer doesn’t believe in that “liberal nonsense” due to their religious convictions. When requirements don’t match physical reality, nothing you can do can save the project.

---

<div class="post-metadata">

**Author:** ![jnareb](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/jnareb/32/36319_2.png) [@jnareb](https://discourse.codinghorror.com/u/jnareb)\
**Post date:** [July 30, 2015, 11:31am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/3 "2015-07-30T11:31:05Z")

</div>

> Let’s start with Patrick McKenzie’s classic [Falsehoods Programmers Believe about Names](http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/):

IMVHO a **much** better resource with respect to problem with names is W3C Internationalization’s _[Personal names around the world](http://www.w3.org/International/questions/qa-personal-names)_, mostly because it has **examples** for each uncommon case, instead of being bare bones plain-list of falsehoods.

---

<div class="post-metadata">

**Author:** ![kram1032](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/k/9de0a6/32.png) [@kram1032](https://discourse.codinghorror.com/u/kram1032)\
**Post date:** [July 30, 2015, 12:00pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/4 "2015-07-30T12:00:20Z")

</div>

Here are two videos that also nicely make this point:

On Time:

[![](https://discourse-cdn.codinghorror.com/uploads/default/original/3X/9/e/9e3e3f8b2f436554f9ba05ddf9e0c8d96b74abb5.jpeg "The Problem with Time & Timezones - Computerphile") ](https://www.youtube.com/watch?v=-5wpm-gesOY)

On Internationalization:

[![](https://discourse-cdn.codinghorror.com/uploads/default/original/3X/4/c/4c62cc364792be6c79520e5c5f586a74736fbb86.jpeg "Internationalis(z)ing Code - Computerphile") ](https://www.youtube.com/watch?v=0j74jcxSunY)

---

<div class="post-metadata">

**Author:** ![meglio](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/meglio/32/72783_2.png) [@meglio](https://discourse.codinghorror.com/u/meglio)\
**Post date:** [July 30, 2015, 12:06pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/6 "2015-07-30T12:06:56Z")

</div>

Something tells me you wrote this article in the answer to a real case happened recently in Discourse, behind the scenes? Just curious.

---

<div class="post-metadata">

**Author:** ![kram1032](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/k/9de0a6/32.png) [@kram1032](https://discourse.codinghorror.com/u/kram1032)\
**Post date:** [July 30, 2015, 1:25pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/9 "2015-07-30T13:25:32Z")

</div>

I’m not sure about the medical forms you saw but the ones I saw typically list “sex” rather than “gender”.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Breck\_McKye](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/jimmy_breck_mckye/32/73501_2.png) [@Jimmy\_Breck\_McKye](https://discourse.codinghorror.com/u/Jimmy_Breck_McKye)\
**Post date:** [July 30, 2015, 2:11pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/11 "2015-07-30T14:11:27Z")

</div>

So, what are intersex individuals listed as?

And so what if someone does say they want to be considered third gender, regardless of physical sex? Outside of the medical usecase, what’s the point in preventing them? Does it really matter to anyone?

---

<div class="post-metadata">

**Author:** ![Joseph\_Zoller](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/joseph_zoller/32/73502_2.png) [@Joseph\_Zoller](https://discourse.codinghorror.com/u/Joseph_Zoller)\
**Post date:** [July 30, 2015, 2:44pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/12 "2015-07-30T14:44:03Z")

</div>

Perhaps people remember the “time to first crate” used for older fps games… the time it takes for the first destructible crate to appear on a level.

I assure you, QA has a “time to first bug” contest going on the new software release. Nothing like a nice, target rich environment for a good day of testing.

---

<div class="post-metadata">

**Author:** ![SoniEx2](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/s/898d66/32.png) [@SoniEx2](https://discourse.codinghorror.com/u/SoniEx2)\
**Post date:** [July 30, 2015, 3:05pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/13 "2015-07-30T15:05:57Z")

</div>

Add more Tom Scott:

[![](https://discourse-cdn.codinghorror.com/uploads/default/original/3X/a/5/a532bcfb43a747717b4c3cd30e2e58190e8606e9.jpeg "Gender Neutral Pronouns: They're Here, Get Used To Them") ](https://www.youtube.com/watch?v=46ehrFk-gLk)

---

<div class="post-metadata">

**Author:** ![unclemikey](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/unclemikey/32/72810_2.png) [@unclemikey](https://discourse.codinghorror.com/u/unclemikey)\
**Post date:** [July 30, 2015, 3:36pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/15 "2015-07-30T15:36:53Z")

</div>

I still think that the Chinese have the right idea: no more timezones!

Although…think about how much would break if suddenly time zones were NOT a thing any more…

---

<div class="post-metadata">

**Author:** ![Wayne\_Riddle](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/w/ce73a5/32.png) [@Wayne\_Riddle](https://discourse.codinghorror.com/u/Wayne_Riddle)\
**Post date:** [July 30, 2015, 4:21pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/16 "2015-07-30T16:21:20Z")

</div>

Add to the list “People will have administrator rights on their machine to install my program”.

---

<div class="post-metadata">

**Author:** ![dennisdjensen](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/d/ecb155/32.png) [@dennisdjensen](https://discourse.codinghorror.com/u/dennisdjensen)\
**Post date:** [July 30, 2015, 5:49pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/17 "2015-07-30T17:49:54Z")

</div>

As somebody who works in healt-care, I can assure you it’s not politically bullshit. The doctors here work with varying definitions of gender depending on what they are trying to do. You are right it’s a medical issue. Also, hermaphrodites are naturally born once in a while.

---

<div class="post-metadata">

**Author:** ![DanAtkinson](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/danatkinson/32/73508_2.png) [@DanAtkinson](https://discourse.codinghorror.com/u/DanAtkinson)\
**Post date:** [July 30, 2015, 6:28pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/18 "2015-07-30T18:28:32Z")

</div>

1992 wasn’t pre-Internet - it was pre-web. The Internet was very much around, and I’m surprised that, whilst you were at college, you didn’t have any knowledge of it or interaction with it.

---

<div class="post-metadata">

**Author:** ![rhh333](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/r/97f17d/32.png) [@rhh333](https://discourse.codinghorror.com/u/rhh333)\
**Post date:** [July 30, 2015, 7:01pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/19 "2015-07-30T19:01:49Z")

</div>

If capturing gender is a requirement of the system, then, as part of good design, one should consider edge cases. The list simply provides examples of cases encountered. Nothing to do with political correctness; it is about data integrity.

If you don’t like the fact that systems capture gender (or over-collection of data in general) that may be interesting to consider during the requirements phase, but not related to an article about testing.

---

<div class="post-metadata">

**Author:** ![cawas](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/cawas/32/72978_2.png) [@cawas](https://discourse.codinghorror.com/u/cawas)\
**Post date:** [July 30, 2015, 8:16pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/20 "2015-07-30T20:16:39Z")

</div>

Disclaimer: this will **probably** be just a self note which will make no sense to anyone else…

In my case, I never thought I were the best programmer (or anything, for that matter) anywhere. Maybe because there were always someone better than me near enough… And to yet another opposite thing, Test Driven Development was always so much in my blood that I never really cared that much for abstracting it. Testing was just a natural thing to do. Also reason why I always hated having to deal with date and time. That is until good libraries came around, at some point in 2000’s.

---

<div class="post-metadata">

**Author:** ![KevinFreund](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/kevinfreund/32/73515_2.png) [@KevinFreund](https://discourse.codinghorror.com/u/KevinFreund)\
**Post date:** [July 30, 2015, 10:30pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/21 "2015-07-30T22:30:56Z")

</div>

I had this argument as a mid-level developer working on a government project. In hindsight it seems about as important an argument as who is the best Dr. Who.

The forms we were building all used the term “gender” in place of “sex” which I thought was goofy, because the rationale was that the word “sex” was not politically correct, despite the possible values being “male/female” versus “masculine/feminine”. I just did what they asked me to and shrugged my shoulders. Not even close to the top of the list of bad government design decisions on that project.

How about leaving gender as an enumerated numeric data type and letting the customer worry about how to label the values?

I worked on a medical application where there were valid reasons to have other values in the place of “Male/Female”, so I created an open-ended enumeration started with “Male/Female” and walked away. Unless there are any evaluations required, this is a moot argument. If there are evaluations required, why not (JSON):

```auto
[
  {
    id: 0,
    label: 'Male',
    evaluateAs: 0,
  },
  {
    id: 1,
    label: 'Female',
    evaluateAs: 1,
  },
  {
    id: 2,
    label: 'Male, born Female',
    evaluateAs: 0
  },
  {
    id: 3,
    label: 'Female, born Male',
    avaluateAs: 1
  }
]

```

But to make the developer guidelines an argument about conservative vs. liberal and political correctness is simply obnoxious, is wholly unprofessional, and misses the point of the post, which is about testing code, not about the politically correct customer and how stupid he may or may not be.

---

<div class="post-metadata">

**Author:** ![EMRhap](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/emrhap/32/73519_2.png) [@EMRhap](https://discourse.codinghorror.com/u/EMRhap)\
**Post date:** [July 31, 2015, 3:06am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/22 "2015-07-31T03:06:36Z")

</div>

I was having a particularly rough day today, and just had a feeling that you would be able to help. Thanks for this post, as it has reaffirmed my position to delete and remove as much crappy dead software as possible. This blog post is going on my internal team wiki as we are all new owners of some really old crappy, crufty stuff that has a lot of opportunity for improvement.

Many thanks for yet another gem.  
/Em

---

<div class="post-metadata">

**Author:** ![BTG174](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/b/50afbb/32.png) [@BTG174](https://discourse.codinghorror.com/u/BTG174)\
**Post date:** [July 31, 2015, 9:19am UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/23 "2015-07-31T09:19:41Z")

</div>

🙂 Back in the day i managed to crash an A17 then Unisys largest mainframe by doing agressive testing 🙂

---

<div class="post-metadata">

**Author:** ![fengyi\_wu](https://discourse-cdn.codinghorror.com/letter_avatar_proxy/v2/letter/f/43a26b/32.png) [@fengyi\_wu](https://discourse.codinghorror.com/u/fengyi_wu)\
**Post date:** [July 31, 2015, 1:32pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/24 "2015-07-31T13:32:28Z")

</div>

Chinese did not do any test during software development?

---

<div class="post-metadata">

**Author:** ![RvLeshrac](https://discourse-cdn.codinghorror.com/user_avatar/discourse.codinghorror.com/rvleshrac/32/75647_2.png) [@RvLeshrac](https://discourse.codinghorror.com/u/RvLeshrac)\
**Post date:** [July 31, 2015, 2:40pm UTC](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483/25 "2015-07-31T14:40:01Z")

</div>

That’s not a bad solution, except that in a medical environment, the glaring bug is liable to result in someone’s injury or death. Medical is a 0%-margin-of-error industry (even though it doesn’t seem like it sometimes…)

In a non-medical environment, this offends the people who think there are 0 sexes. Or 9. Or an infinite number of gradations.

And what of the people who believe that you can be one sex Monday, a different sex Tuesday, and yet another Wednesday?

[Next page](https://discourse.codinghorror.com/t/doing-terrible-things-to-your-code/3483.md?page=2)
