Women and the Quality of Code
A good way to stir up some controversy is to bring up possible differences between the way men and women write code. Add to it a tone that suggests that women write better code, and you’ll really get people talking. Is there something to it? Would you really be able to tell the difference between male and female code, and could you really say that one is better than the other?
Programming computer applications involves writing multiple lines of instructions that will be turned into something a computer can understand. When writing these instructions, or code, a programmer can also add extra information that the computer will ignore, called comments. To get a bit of an idea of what code is all about, go to ‘View, Page Source’ on your browser to see what a web page really looks like. When we ask about the differences between code that men and women write, we are talking about what instructions are used, what style is used to write them, and what kinds of comments are included.
A story was recently featured on Slashdot, a news website geared towards nerds like us, called Men Write Code from Mars, Women Write More Helpful Code from Venus – I think you’ll probably agree that even the title sets the ‘women are better’ tone! This article describes how “Emma McGrattan, the senior vice-president of engineering for computer-database company Ingres – and one of Silicon Valley’s highest-ranking female programmers – insists that men and women write code differently.”
Apparently, McGrattan believes that women’s code tends to include more useful comments than men’s. She says that women use comments to explain what they were thinking when writing their code so it is easy to understand by programmers that haven’t seen it before. On the other hand, she suggests that men actually try to make their code more cryptic, with fewer useful comments, in an effort to show how clever they are. To help fix this problem, she set up rules and standards for Ingres programmers to follow, forcing everyone to document their code, and any changes they made to other peoples’ code, with detailed comments.
The comments section back at Slashdot has some interesting reaction. One reader says:
It’s now well established that the human brain builds negative stereotypes more easily than positive ones and that people see what they are expecting and apply a double standard. This person sees what she wants to see.
Another points out:
Personality is complex, not binary. I know many girls that code beautifully, and many more that can not code at all.
The general theme throughout the comments is that men and women do think differently, but that neither writes better code than the other, nor could you really tell the difference arbitrarily.
Interestingly, there seems to be a good selection of research trying to determine whether men and women write English compositions differently. One study concludes that “there are indeed different strategies employed by men and women in setting forth information and especially in encoding the relation between writer and reader in texts.” In other words, there are apparently several indicators that can help decide fairly reliably whether a text was written by a male or female, such as the number of personal pronouns (I, we, you) used in place of noun specifiers (much, some). Could this difference extend to how men and women write code, too?
From my own job experience in two different companies, I can say that I was very careful to write useful comments, and was even complimented for it. While some of the guys did occasionally forget to add in the same kind of detailed comments that McGrattan is asking for, many of them wrote just as many comments as I did. On the flip side, some of the girls I worked with barely wrote any at all! In my case, it really did seem to depend on the person, not the gender.
So what’s the answer to the question of whether women write better code than men? And is it possible to tell the difference between women’s and men’s code just by looking at it? There may be some noticeable trends like those found in English composition, but this has yet to be scientifically studied as far as I know. Besides, until women make up a little closer to half of the programming workforce, how can we do a fair comparison? I think we’ll have to mark this one down as inconclusive for now, though I’m leaning toward a no for the part about women writing better code. What do you think?
Comments
-
Solar Barb (July 29, 2008) says:
I believe differences in the way people code depend on their personality and not necessarily their gender. It takes patience, organization skills, and experience to write good code/documentation. I also believe that the employer’s guidelines in writing code/documentation play a very important role. If there are no guidelines in place, why would anyone want to put the extra effort?
I think that the stereotype that women’s code is “better” comes from the stereotype that women are more
1. patient
2. natural teachers
3. prone to pay attention to detail
4. neatthan their male counterparts, all of which are important in writing good code/documentation. Now that’s controversy for you!
-
divs (August 04, 2008) says:
Agreed on leaning toward “no” - one woman’s opinion at a company hardly makes for such a generalization. Code quality probably has a lot more to do with your teachers and early job managers than your gender!
-
miffanytiller (August 14, 2008) says:
I can definitely see where guys and gals code differently and agree with the cryptic way guys code. I recently finished up a CS course over the summer that I took online. With my group was one other girl and a guy, let’s call them Bill and Sally.
When Bill would start our code for a project, his variables would be very simple like i, j, k, ...stuff like that, whereas when Sally and I would begin the code, we would use more complex variables like counter, loop_counter, value_min...stuff that would be able to tell us what that variable was doing at a first glance.
It’s just a different way of thinking is all it is. I wouldn’t say that women necessarily write BETTER code, but it may be that it’s written in a better way that can be more helpful to others who need to revise it. :) It’s just a difference in the way we all think, and heck - that varies from person to person too...not necessarily just gender.
-
Solar Barb (August 15, 2008) says:
I also name my variables so they are more descriptive, but so do my male colleagues. We were taught that technique in our undergrad programming classes… and actually, I was taught that in high school. This goes back to the previous comments: the way one codes has a lot to do with one’s teachers, employers, experience, and personality.
-
TheXenocide (August 15, 2008) says:
It seems as long as people are willing to associate traits with gender, race, age, and orientation people will never truly value the most wonderful thing about humanity: the ever diversifying incredibly dynamic personality of the individual. By non-scientific standards like this one could just as easily say men are capable of writing more complex solutions because more of them have throughout history. Stereotypes are generally based on observations that seem to occur commonly, but when put to the test of scientific method results vary greatly by environment, class, age and a million other variables people just don’t take into account with on-the-fly theories like this. I’m not saying the girls *there* don’t have better commenting standards, but I’ve seen some pretty killer comments from men too; I wonder if she gets out much? The real question is which gender will be the first to write the app that lets you slap someone in the face over the internet :p.
Hi! We'd love to hear what you think about this post. Join our community (it's fast and free!) and you can make comments to blog posts, participate in the community forums, and be a pivotal part of the Nerd Girls movement! If you're already a member, please login before commenting.