Do Women Write Better Code? 847
JCWDenton writes "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. Women are more touchy-feely and considerate of those who will use the code later, she says. They'll intersperse their code ... with helpful comments and directions, explaining why they wrote the lines the way they did and exactly how they did it. The code becomes a type of 'roadmap' for others who might want to alter it or add to it later, says McGrattan, a native of Ireland who has been with Ingres since 1992. Men, on the other hand, have no such pretenses. Often, 'they try to show how clever they are by writing very cryptic code,' she tells the Business Technology Blog. 'They try to obfuscate things in the code,' and don't leave clear directions for people using it later. "
That's not why! (Score:3, Interesting)
Yeah... the advice to add comments explaining why and how is good, but how about you stop telling us what we're thinking and what our motivations are. If I do do something "clever", I'll sure as hell make it clear how it works and why I did it. And the reason for it is because it's the best way to do things. I don't have to prove anything.
Not my experience (Score:5, Interesting)
Case in point. We have a coder who wrote an application for our office. Because of the fact that she refused to use any variable for the Program Files folder (hard coded as "c:\Program Files\") and she insisted that all workstations need a D: partition (to hold a 100kb support file), we had to rebuild 4 servers.
Say what you will about women coders being "touchy feely." I won't fall for it, any more than the NOW propoganda that all women are natural caring mothers, even the coked out alcoholics.
Ingres needs help (Score:1, Interesting)
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:4, Interesting)
Gender differences (Score:5, Interesting)
Not worse, nor better really, just ... different
So yes, I can see women writing 'better' code, but I still think that's more likely to be a matter of training and discipline, as much as anything else. Or perhaps the 'female geek' effect - in a word where you'll be faced with massive prejudice and pressure, the 'female techy' is typically (and yes, I realise this is a broad generalisation) even more hardcore than male counterparts - simply because she's there because she _really_ wants to, and has had to face a lot of uphill struggle to get there. This seems to hold true in petrolhead circles too (see, I can do car analogies too) - the few 'girl racers' I've met, have extremely extreme car mods, and rigs, because they're competing against everyone else _and_ the gender stereotype.
Sexual orientation and coding style? (Score:3, Interesting)
As an additional dimension to this question:
I'm a gay man, and I've been told that my code is unusually clear. I think of my code as a letter that I'm writing to the next person who has to work with it. (Frankly, I consider clarity in code to be a measure of the competence of the programmer.)
Obviously, a pattern can't be drawn from one individual. However, if there's any validity to the claim about a difference in coding styles between the male and female populations, I wonder whether gay men tend to pattern one way or the other.
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:3, Interesting)
Only Difference I found is... (Score:1, Interesting)
Male:
int iBlobPermBF;
Female:
int iBinaryBitFieldForPermissions;
pseudo psychology (Score:1, Interesting)
In general, sensate thinkers (ST) greatly outnumber intuitive thinkers (NT). When someone thinks of "male programmers", they are actually thinking of "male ST programmers" that like to show how clever they are by writing cryptic code.
The NT programmers that I've worked with try to show off by explaining the concepts behind the code through comments and diagrams, which is often a good thing.
Think differently? (Score:4, Interesting)
Perhaps it's just that for men, IT's a reasonable and expected field to go into, but for women, it's not as much, so a woman going into IT is much more likely to be well-suited for it and better at it?
It might have very little to do at all with the difference in thought processes between men and women.
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:4, Interesting)
Re:Do women write better code? (Score:5, Interesting)
Oh, wait, I have met a few others. They were no longer coding, they somehow had left the field and had a change of careers (working minimum wage jobs through a contract agency...) Actually, no different than after the big dotcom bubble pop and I met several (male) "network admins" who were (and still are, 7? years later) driving delivery truck. Seems they can't find a job in their field of choice again. I think the companies were looking for any excuse to let them go as these guys were from some very large manufacturing companies that really weren't effected by the dotpop.
Seriously, how many women, percentage wise compared to men, are in the field? How can they come up with some stat that says women are better programmers if you've got (pulling number out of air) 1 woman to every 1000 men in the field? How about a statement like "a percentage of women who become programmers and are successful at it (as in my experience a lot are not, but that's no different than men), tend to be better programmers than men"
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:5, Interesting)
At the same time my boss who was also his boss had an anatomical poster "Penises of the Animal Kingdom" on her wall with to scale anatomical drawings of about 10 different species penises - including homo sapien. HR never asked her to remove it, and she was in a position of authority.
Never really bothered me, but did show me that sexism and sexual harassment rules are applied differently to men than to women.
Code Janitor (Score:4, Interesting)
I have not noticed any sexual bias for bad code. Some people have it and some people do not. I see tons of unneeded and often unused variable with poor names. Databases with numeric fields where text should be and vice versa. Platform or vendor specific techniques where generic ones will do just as well.
Oh yeah, I have seen the deliberate obfuscation. (Ranjeev Dolas where are you?) Splicing assembly code into a 4GL Informix program to make it say "Is the third octet = 192?". It is not hard to see when people have deliberately made things hard for others to figure out, probably all for job security.
Me on the other hand, I know that I will probably be the fool that has to come back to this code later and fix it again. So I add comments to the things I can figure out and even to the things I cannot. Put comments and dates around my fixes. After a while the code starts to look like my own.
My poor code comes from my throw-away programs. The kind you write once to solve a problem today. You run the code once and never expect to touch the code again. Except next month, a really similar tool is needed. Now I go back to my old code, if I can find it, and OMG it looks like a freaking third grade did it with construction paper and crayons. This is my biggest downfall.
Re:Do women write better code? (Score:2, Interesting)
Yeah, that was too much, even for me, definitely gonna go AC.
Brain scans,and case studies verify this result (Score:3, Interesting)
Men really do think differently than women. Numerous studies of brain activity, using CAT and similar scanners, find that different areas of the brain are active during similar tasks. Just this week, another study was published showing that the brain activity in gay men is very similar to straight women, and that the activity in lesbian women is similar to straight men, and that brain activity in straight men is very different from straight women.
I work in a system of several million LOC, with a hundred different authors over the course of two decades. I know all of the developers, and I see the difference in the code all the time. Code written by women or gay men is much easier to read, and rarely requires maintenance to fix bugs. Code written by straight men is often uncommented, difficult to read, and requires frequent maintenance to fix bugs. (I don't think we have had any lesbian programmers.) The maintenance frequency shows up very strongly in the reports from the revision control system.
I try to make my code beautiful and clear, in addition to being correct. And verifiable theoretical correctness is better than just passing the test case. The straight men I work with don't seem to be concerned with aesthetic values or theoretical correctness. They just want it to work for the immediate test case. Then they have to work on it again, to fix bugs, usually ten or more times in the first year that the module exists.
If frequency of repair (bug fixes) is an indication of quality, straight women and gay men produce higher quality code, and the numbers prove it. It really is quicker to do it right once than to rush and then fix it later. But, to do so seems to require a different way of thinking.
Perhaps we should go out of our way to recruit women and gay men.
Re:Do women write better code? (Score:5, Interesting)
As for female programmers, I was a CS tutor at my university growing up and I can state from experience that any female that was able to make it through CS 101 was a much better programmer than their male counterparts on average. Unfortunately these females were all on the education path so they didn't go into dev work.
Interesting sidenote; the females that didn't make it did cry a lot more but would forge on, the guys just threw hissy fits when they couldn't get concepts and drop the class. Maybe there is a bit to the female capacity to persevere and the male stubbornness :)
Re:Do women write better code? (Score:1, Interesting)
It's not guaranteed obviously, but there are data points to support some correlation.
Sexism's Only Alright If It Favors Women (Score:5, Interesting)
I had an experience like this at Hewlett-Packard in Camas, WA in 1993. I was assigned to tear apart fully-assembled printers so that the parts could be used for prototypes of the next generation. I worked alone in a room filled with printers. No one had access to this room except from me and my (supposedly) male boss.
After a few weeks, I put a close-up picture of Claudia Schiffer on the PC's wallpaper. My boss saw it and flipped out. He ordered me to remove it immediately. I said that I liked it and that no one could be offended because no one had access to the room.
A day later I was fired from Hewlett-Packard for 'creating an environment conducive to sexual harassment'. I couldn't get unemployment benefits.
To this day I hate H-P and I don't believe anything anyone says about it being an advanced or great company. I will never sign off a purchase order for any of their products for any company that I work for. I suspect that most of the so-called great companies in the electronics/computer industry are the same way.
Re:Do women write better code? (Score:4, Interesting)
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:5, Interesting)
How much of that is social? I would think how a girl grows up is very different from how a boy grows up. If a boy joins boy scouts, goes hunting with dad, etc then he'll see a map as something with directions and distances. If a girl doesnt get these experiences, she may never see a map until she learns how to drive and at that point has internalized her surroundings by using landmarks.
I think many of the things we write up to genetic determinism really have social roots.
Re:Remember: Sexism's Only Alright If It Favors Wo (Score:3, Interesting)
Re:Do women write better code? (Score:4, Interesting)
I think there will be women who write better code than some men, and men who write better code than some women. Obviously most of the coders in the world are male though, that is just how it has turned out so far.
I have only met one woman who I know must have been a half-decent coder. She often got among the top marks in all of our classes at University, and obviously put more effort in than most, as well as being bright, so I expect her code must have been okay. And then again there was another girl in our classes, who once came over and tried to get me to basically do her assignment for her. I politely tried to help her along without actually giving her the answer (as I think any good teacher would/should do when asked for help), but could tell that she didn't actually care and was just trying to get me to do it for her, so I eventually got pretty pissed off and thankfully she just took the hint and moved on to the next unsuspecting sex-deprived geek. I was confused as to why someone like that would even do Computer Science at University level.. and how she managed to get so far. She probably was quite bright too, but just lazy.
Anyway, anecdotal evidence can always be found to argue one way or the other, it doesn't mean much at all. I have met plenty of smart guys and girls, and plenty of dumb ones. This article is just flame bait. I would say that I believe that women in all societies are naturally more empathetic and considerate, for whatever reason, but I personally comment my code or try to make it as obvious as possible what is happening with sensible variable names, etc. Not all guys are macho jerks out to show that they are 'smarter' than the rest. In fact I'd say the truly smarter guys are the ones who are sensible enough to write their code in a way that it can easily be maintained by themselves or others in future. I know I've come back to my code after weeks/months and been like wtf!? I then proceed to delete a line of code that looks like it is completely extraneous, only to find that a completely different section of my program relies on it being there, it's just that everything has been modified so many times (either through my own fault or by management always asking for things in the program to be changed far beyond the original agreed implementation..) that it is in a mess.
Re:Do women write better code? (Score:3, Interesting)
I generally can't stand code that was written by a male... specifically because it's not usually commented, or when it is commented, it's stuff that is relatively useless, like:
There are people who break the mold, though... when writing for myself, I don't generally comment it. My coding style hasn't changed in a decade, and I have a damned near eidetic memory. I can look at code I wrote 10 years ago, and still understand how it works and not need comments. When I'm writing for somebody else, I'll comment the bejeezus out of it, just like the story claims. *shrugs* I've been known to pull out examples of code I wrote a long time ago and spend time adding comments before I pass it on to somebody who needs it.
Re:Do women write better code? (Score:3, Interesting)
Re:Sexual orientation and coding style? (Score:3, Interesting)
The biggest system disaster I have been close to was headed by two women who we all suspected, but do not know, were lovers. They were horrible developers. One of the best SDET's I know is a gay woman, one of the best web devs I know is a gay man. One of the most anal and anti-productive programmers I know is a gay man. One of the better large project managers I know is a gay woman.
I haven't known many excellent pure programmers that are female, but, truth be told, female programmers of any skill are pretty rare.