Saturday, July 28, 2012

Immature Programming

The other day I came upon the following article:

"Microsoft Apologies for "Big Boobs" Coding Gag"

The short story, a Microsoft programmer had put "0xB16B00B5" (i.e. "big boobs") in some Linux kernel code.

I thought this quote in the article summarized my thoughts on the subject
"At the most basic level it's just straightforward childish humour, and the use of vaguely-English strings in magic hex constants is hardly uncommon. But it's also specifically male childish humour. Puerile sniggering at breasts contributes to the continuing impression that software development is a boys club where girls aren't welcome."
I couldn't agree more.

Then I paused for a second ...

While I like to think of myself as having always been the consummate professional, I suppose I was once younger and more immature.  I was once told the following "cool" hex string by an older programmer and put it into some code maybe 10 or so years ago:
#define _MAGIC  0xcafebabe
IMO not as bad as "big boobs", but not exactly good.

So when I was told this "cool" hex string, a younger version of me thought nothing of it.  The fact older colleagues also thought it was cool, probably established the idea this kind of thing was acceptable.

A now older version of me now would pause and think "I probably shouldn't."

So what's the lesson learned now that I'm a tad older?

A) I shouldn't encourage this by teaching it to younger engineers

B) I should never accept them in patches or let them get through code reviews.

Update (8/1/12):

Sigh, the ghost of 0xcafebabe affected me another time somewhat recently.  A colleague of mine had programmed:
#define PLUGIN_FOO_INIT_NUMBER 0xcafe
When I had to write a new plugin, I copied his code to start the new one.  What did I put at the top of the file?
#define PLUGIN_BAR_INIT_NUMBER 0xbabe
Well, the best thing I can do is admit the mistake, change the code, and be more conscious of this in the future.


Sunday, July 15, 2012

Statistical Pet Peeve - The Divorce Rate

Since I was in highschool and talked to friends about various social issues, the "divorce rate" in America is brought up at some point to discuss social issues.

The "divorce rate" is a statistical pet peeve for me. The reason is that the statistic makes no sense. What is the divorce rate? Is it

  • The divorce rate of currently married couples?
  • The divorce rate of married couples in the past year?
  • The divorce rate of 1000 people over the first 5 years of marriage?

It's terrible. The major issue is that there is no time limit or length of time over which these statistics are measured. A "successful marriage" is normally considered one in which one spouse eventually passes away (i.e. "Til death do us part"). So if a couple gets married, then one partner dies the next day, it's considered a successful marriage because it did not lead to divorce (technically, I suppose it's a successful marriage even if someone is murdered by their spouse). However, a couple married for 50 years before deciding to get divorced is a failed marriage.

One of the most cited statistics in divorce is "50% of marriages end in divorce", which is a completely miscalculated statistic. Apparently, the statistic was generated by the fact 1.2 million divorces occurred in 1981, while 2.4 million marriages occurred in 1981. [reference]

I'm not a statistics person by trade, so I don't know what the best statistic would be. I think a statistic measuring average marriage length would be a pretty good one. Or perhaps just statistics that inform you of time frames. For example, "X% of marriages end in divorce within 1 year" or "Y% of marriages last greater than 10 years" would be far better statistics.