Gender and programming

Posted in Hacking, programmer productivity, robobait, Technology trends at 11:44 am by ducky

I had a very brief but very interesting talk with Prof. Margaret Burnett.  She does research on gender and programming. at Oregon State University, but was in town for the International Conference on Software Engineering.  She said that many studies have shown that women are — in general — more risk averse than men are.  (I’ve also commented on this.)  She said that her research found that risk-averse people (most women and some men) are less likely to tinker, to explore, to try out novel features in both tools and languages when programming.

I extrapolate that this means that risk-seeking people (most men and some women) were more likely to have better command of tools, and this ties into something that I’ve been voicing frustration with for some time — there is no instruction on how to use tools in the CS curriculum — but I had never seen it as a gender-bias issue before.  I can see how a male universe would think there was no need to explain how to use tools because the figured that the guys would just figure it out on their own.  And the most guys might — but most of the women and some of the men might not figure out how to use tools on their own.

In particular, there is no instruction on how to use the debugger: not on what features are available, not on when you should use a debugger vs. not, and none on good debugging strategy.  (I’ve commented on that here.)  Some of using the debugger is art, true, but there are teachable strategies – practically algorithms — for how to use the debugger to achieve specific ends.   (For example, I wrote up how to use the debugger to localize the causes of hangs.)

Full of excitement from Prof. Burnett’s revelations, I went to dinner with a bunch of people connected to the research lab I did my MS research in.  All men, of course.  I related how Prof. Burnett said that women didn’t tinker, and how this obviously implied to me that CS departments should give some instruction on how to use tools.  The guys had a different response: “The departments should teach the women how to tinker.”

That was an unsatisfying response to me, but it took me a while to figure out why.  It suggests that the risk-averse pool doesn’t know how to tinker, while in my risk-averse model, it is not appropriate to tinker: one shouldn’t goof off fiddling with stuff that has a risk of not being useful when there is work to do!

(As a concrete example, it has been emotionally very difficult for me to write this blog post today.  I think it is important and worthwhile, but I have a little risk-averse agent in my head screaming, screaming at me that I shouldn’t be wasting my time on this: I should be applying for jobs, looking for an immigration lawyer, doing laundry, or working on improving the performance of my maps code.  In other words, writing this post is risky behaviour: it takes time for no immediate payoff, and only a low chance of a future payoff.  It might also be controversial enough that it upsets people.  Doing laundry, however, is a low-risk behaviour: I am guaranteed that it will make my life fractionally better.)

To change the risk-averse population’s behaviour, you would have to change their entire model of risk-reward.  I’m not sure that’s possible, but I also think that you shouldn’t want to change the attitude.  You want some people to be risk-seeking, as they are the ones who will get you the big wins.  However, they will also get you the big losses.  The risk-averse people are the ones who provide stability.

Also note that because there is such asymmetry in task completion time between above-median and below-median, you might expect that a bunch of median programmers are, in the aggregate, more productive than a group at both extremes.  (There are limits to how much faster you can get at completing a task, but there are no limits to how much slower you can get.)  It might be that risk aversion is a good thing!

There was a study I heard of second-hand (I wish I had a citation — anybody know?) that found that startups with a lot of women (I’m remembering 40%) had much MUCH higher survival rates than ones with lower proportions of women.  This makes perfect sense to me; a risk-averse population would rein in the potentially destructive tendencies of a risk-seeking population.

Thus I think it does make sense to provide academic training in how to use tools.  This should perhaps be coupled with some propaganda about how it is important to set aside some time in the future to get comfortable with tools.  (Perhaps it should be presented as risky to not spend time tinkering with tools!)

UPDATE: There’s an interesting (though all-too-brief!) article that mentions differences in the biochemical responses to risk that men and women produce.  It says that men produce adrenaline, which is fun.  Women produce acetylcholine, which the article says pretty much makes them want to vomit.  That could certainly change one’s reaction to risk..


Arkansas liberalism?

Posted in Maps, Politics at 6:38 pm by ducky

I added a state legislatures partisanship layer to my election map, and also modified a metric which shows kind of how liberal an area is.  For every governor, US senator, or US congressman in a district that is a Democrat, I added one.  For every legislator who is a Republican, I subtracted one.  Now, with the new data, I also add one point for each state legislative chamber that is controlled by Democrats, and subtract one for each that is controlled by Republicans.

This gives me a range of -6 to plus 6 (governor, two US senators, one US congressman, one state senate, one state lower chamber), which I can show in shades of red to blue:


Some things are not surprising: the northeast is very blue; Idaho and Utah are very red.  However, I don’t get Arkansas.  I wouldn’t have thought that it would be culturally very different from its neighbours, yet most of the state has the maximum value of +6.

Is this all due to Clinton?  Did he build a really strong Democratic Party operation in Arkansas?  Or did he throw a bunch of money towards Arkansas, for which they are still grateful?

Can anyone familiar with Arkansas shed any light on this?


A reader from Arkansas explained that the Arkansas Democratic party is very entrenched and strong, but that the populace is not particularly liberal.  Essentially, people who are Democrats in Arkansas would be Republicans just about anywhere else.  (This is similar to the Liberal Party in BC, which is the most conservative of the three viable parties in BC.  The Liberal Party in BC is much more conservative than the Canadian federal Liberal party.)


Harvard, creativity, and university reform

Posted in University life at 12:59 am by ducky

Jerome Dolittle recently reported via James Fallows that he had asked thirty Harvard first-year students to redesign universities from the ground up; 29 of 30 came up with, as the author put it, “something that looked very much like Harvard, except a little farther out of town”.  He seemed to take this as evidence that Harvard students were not very creative.

This was in response to an article by Randy Pollack talking about how uncreative Chinese MBA students were: when asked to come up with a the most original idea they could for a business, e.g. a restaurant chain, five of six groups came up with the idea of — a restaurant chain!  This was given as evidence of how the Chinese educational system did not foster creativity.

Dolittle seemed to think that the Harvard students were just as uncreative as the Chinese students, but I don’t think that comparison is fair.  I think that reforming education is a much more difficult problem for first-year students than thinking of a business would be for MBA students.

In addition to the age difference and the difference in academic focus, the MBAs had probably encountered hundreds if not thousands of businesses and products in their day-to-day life.  I would bet that the majority of the Harvard freshman had intimate knowledge of exactly one university.  It’s difficult to consider how you can change something if you don’t have an idea of the number of degrees of freedom you have.

Even faculty have difficulty being creative about reforming universities.  Recently there was a New York Times opinion piece End the University as we know it that got quite a bit of buzz in my circles, despite its recommendations being, in my opinion, not very creative:

  1. Restructure the curriculum to be more interdisciplinary.
  2. Abolish permanent departments, replacing them with problem-focused temporary departments (e.g. Water).
  3. Collaborate more across institutions.
  4. Allow dissertations in forms other than things that look like scholarly books.
  5. Give graduate students real-world skills.
  6. Abolish tenure.

Three recommendations (#1,# 3, and #5) are goals that institutions already aspire to.  They might not do it well, but they sure talk about it a lot.

I think people haven’t done #6 because it would lead to either a rise in cost or a decline in quality (or both), not because it wasn’t an obvious thing to try.

Aside from the increased administrative overhead and lack of departmental reputations that #2 would cause, project-based learning has been tried before to some extent.  (Hampshire College is highly individual-project based; Colorado College students take one compressed course at a time.)  One could also easily argue that each graduate student is supposed to create their “department of one”.  (When I got my first MS, I took classes in library science and intellectual property law because that’s what made sense for my area of interest.)

For #4, I believe that it already is possible to do a non-book thesis, particularly in the performing arts.   One friend’s “dissertation” was a symphony.  Another friend made a movie for her anthropology thesis.  While I have a copy of my thesis printed on dead trees, the important version of the thesis is the PDF available on-line.

Even though Taylor’s ideas are not that novel, they got buzz.  I think that means that it is really hard for most people to come up with ideas on how to reform university education.

In contrast to the inexperience of the Harvard freshmen, I have been downright promiscuous with universities.  (I have eight transcripts now, for examplet.) This familiarity helped me identify — fourteen years ago — some core functions of a university institution that I thought could be disaggregated: unidirectional information transfer, interactive learning experiences, caring/paying attention, and certification. I also showed how these pieces could be rearranged by private enterprise and social media. (In later blog posts, I showed how this disaggregation/disintermediation is already happening.)

Now, it is possible that it is a coincidence that I have both unusual intimacy with universities and was able to come up with creative insights about reform.  I suppose it’s also possible that I’m just amazingly brilliant. I don’t think so.  I think that if you see lots of X, then it becomes easier to think creatively about things you could do with X.

It might be that the Harvard students were in fact just as uncreative as the Chinese MBAs.   However, I don’t think Dolittle proved that.


Locally omniscient debugging

Posted in programmer productivity, Technology trends at 4:22 pm by ducky

Update: it turns out that lots of people have done exactly what I asked for: see Instruction-level Tracing:
Framework & Applications
and the OCaml debugger.  Cooool! (Thanks DanE!)

In my user studies, programmers used the debugger far less than I had expected.  Part of that could perhaps be due to poor training in how to use a debugger — it is rare to get good training in how to use a debugger.

However, I think the answer is simpler than that: it is just plain boring and tedious to use a debugger.  One guy did solve a thorny problem by stepping through the debugger, but he had to press “step over” or “step into” ninety times.

And when you are stepping, you must pay attention.  You can’t let your mind wander, or you will miss the event you are watching for.  I can’t be the only person who has done step, step, step, step, step, step, step, boom, “oh crap, where was I in the previous step?”

Omniscient debuggers are one way to make it less tedious.  Run the code until it goes boom, then back up.  Unfortunately, omniscient debuggers capture so much information that it becomes technically difficult to store/manage it all.

I suggest a compromise: store the last N contexts — enough to examine the state of variables back N levels, and to replay if desired.

I can imagine two different ways of doing this.  In the first, the user still has to press step step step; the debugger saves only the state changes between the lines that the user lands on.  In other words, if you step over the foo() method, the debugger only notes any state differences between entering and exiting the foo() method, not any state that is local to foo().  If the user steps into foo(), then it logs state changes inside foo().

In the other method, the user executes the program, and the debugger logs ALL the state changes (including in foo(), including calls to HashTable.add(), etc.).  This is probably easier on the user, but probably slower to execute and requires more storage.

You could also do something where you checkpoint the state every M steps.  Thus, if you get to the boom-spot and want to know where variable someVariable was set, but it didn’t change in the past N steps, you can

  • look at all your old checkpoints
  • see which two checkpoints someVariable changed between
  • rewind to the earlier of the two checkpoints
  • set a watchpoint on someVariable
  • run until the watchpoint.


Churchiness and torture

Posted in Politics at 8:47 am by ducky

CNN released a poll that showed that how often an American Christian goes to church corresponds strongly to how much he/she supports torture.

To a liberal, this makes no sense at all.  The Golden Rule says to treat others as we would like to be treated ourselves, right?  And most people would not want to be tortured, right?  What’s the deal?

It makes sense to me in light of Haight’s findings on morality.  The people who go to church the most often are those for whom belonging to a group is most important, which ties to in-group loyalty.  I can imagine that as in-group loyalty increases, desire to protect the in-group gets fiercer.  Meanwhile, I can imagine that as in-group loyalty increases, respect for/value of people in the out-group decreases.   To put it another way, the higher your loyalty to people who look like you, I bet the less interested you are in preserving the rights of people who don’t look like you.

This is not my value structure.

Update: A friend pointed me to a study that shows that participation in religious rituals (but not how often they prayed) predicts support for suicide bombing!  This was true across cultures — Palestinian Muslims, Israeli Jews, Mexican Catholic, Indian Hindus, Russian Orthodox Christians, UK Protestants, and Indonesian Muslims.  Furthermore, in some of the interviews, they “primed” the interviewee to think about religious affiliation before asking about support for suicide bombing; that turned out to significantly increase reported support for suicide bombing!

This paper thus seems to me to pretty strongly support the CNN poll, albeit indirectly. It seems to me that it not a great leap to replace

  • a suicide bomber from the in-group who kills members of the out-group


  • a torturer from the in-group who tortures members of the out-group.