Sunday, December 28, 2014

If this post reads like I'm blowing my nose every paragraph or two, there's a reason for that.

Via Slate Star Codex, I read Scott Aaronson's comment about being a shy male geek in a feminist world. Normally I wouldn't post it in its entirety, but it is a comment, and the rest of this post won't make much sense without it; having said that, I encourage everyone to read it in context:

Amy #144: Sorry for the delay in answering you; I had to attend to my grandfather's funeral.

You write about tech conferences in which the men engage in "old-fashioned ass-grabbery." You add: "some of the gropiest, most misogynistic guys I've met have been of the shy and nerdy persuasion ... In fact I think a shy/nerdy-normed world would be a significantly worse world for women."

If that's been your experience, then I understand how it could reasonably have led you to your views. Of course, other women may have had different experiences.

You also say that men in STEM fields--unlike those in the humanities and social sciences--don't even have the "requisite vocabulary" to discuss sex discrimination, since they haven't read enough feminist literature. Here I can only speak for myself: I've read at least a dozen feminist books, of which my favorite was Andrea Dworkin's Intercourse (I like howls of anguish much more than bureaucratic boilerplate, so in some sense, the more radical the feminist, the better I can relate). I check Feministing, and even radfem blogs like "I Blame the Patriarchy." And yes, I've read many studies and task force reports about gender bias, and about the "privilege" and "entitlement" of the nerdy males that's keeping women away from science.

Alas, as much as I try to understand other people's perspectives, the first reference to my "male privilege"--my privilege!--is approximately where I get off the train, because it's so alien to my actual lived experience.

But I suspect the thought that being a nerdy male might not make me "privileged"--that it might even have put me into one of society's least privileged classes--is completely alien to your way of seeing things. To have any hope of bridging the gargantuan chasm between us, I'm going to have to reveal something about my life, and it's going to be embarrassing.

(sigh) Here's the thing: I spent my formative years--basically, from the age of 12 until my mid-20s--feeling not "entitled," not "privileged," but terrified. I was terrified that one of my female classmates would somehow find out that I sexually desired her, and that the instant she did, I would be scorned, laughed at, called a creep and a weirdo, maybe even expelled from school or sent to prison. You can call that my personal psychological problem if you want, but it was strongly reinforced by everything I picked up from my environment: to take one example, the sexual-assault prevention workshops we had to attend regularly as undergrads, with their endless lists of all the forms of human interaction that "might be" sexual harassment or assault, and their refusal, ever, to specify anything that definitely wouldn't be sexual harassment or assault. I left each of those workshops with enough fresh paranoia and self-hatred to last me through another year.

My recurring fantasy, through this period, was to have been born a woman, or a gay man, or best of all, completely asexual, so that I could simply devote my life to math, like my hero Paul Erdös did. Anything, really, other than the curse of having been born a heterosexual male, which for me, meant being consumed by desires that one couldn't act on or even admit without running the risk of becoming an objectifier or a stalker or a harasser or some other creature of the darkness.

Of course, I was smart enough to realize that maybe this was silly, maybe I was overanalyzing things. So I scoured the feminist literature for any statement to the effect that my fears were as silly as I hoped they were. But I didn't find any. On the contrary: I found reams of text about how even the most ordinary male/female interactions are filled with "microaggressions," and how even the most "enlightened" males--especially the most "enlightened" males, in fact--are filled with hidden entitlement and privilege and a propensity to sexual violence that could burst forth at any moment.

Because of my fears--my fears of being "outed" as a nerdy heterosexual male, and therefore as a potential creep or sex criminal--I had constant suicidal thoughts. As Bertrand Russell wrote of his own adolescence: "I was put off from suicide only by the desire to learn more mathematics."

At one point, I actually begged a psychiatrist to prescribe drugs that would chemically castrate me (I had researched which ones), because a life of mathematical asceticism was the only future that I could imagine for myself. The psychiatrist refused to prescribe them, but he also couldn't suggest any alternative: my case genuinely stumped him. As well it might--for in some sense, there was nothing "wrong" with me. In a different social context--for example, that of my great-grandparents in the shtetl--I would have gotten married at an early age and been completely fine. (And after a decade of being coy about it, I suppose I've finally revealed the meaning of this blog's title.)

All this time, I faced constant reminders that the males who didn't spend months reading and reflecting about feminism and their own shortcomings--even the ones who went to the opposite extreme, who engaged in what you called "good old-fashioned ass-grabbery"--actually had success that way. The same girls who I was terrified would pepper-spray me and call the police if I looked in their direction, often responded to the crudest advances of the most Neanderthal of men by accepting those advances. Yet it was I, the nerd, and not the Neanderthals, who needed to check his privilege and examine his hidden entitlement!

So what happened to break me out of this death-spiral? Did I have an epiphany, where I realized that despite all appearances, it was I, the terrified nerd, who was wallowing in unearned male privilege, while those Neaderthal ass-grabbers were actually, on some deeper level, the compassionate feminists--and therefore, that both of us deserved everything we got?

No, there was no such revelation. All that happened was that I got older, and after years of hard work, I achieved some success in science, and that success boosted my self-confidence (at least now I had something worth living for), and the newfound confidence, besides making me more attractive, also made me able to (for example) ask a woman out, despite not being totally certain that my doing so would pass muster with a committee of radfems chaired by Andrea Dworkin--a prospect that was previously unthinkable to me. This, to my mind, "defiance" of feminism is the main reason why I was able to enjoy a few years of a normal, active dating life, which then led to meeting the woman who I married.

Now, the whole time I was struggling with this, I was also fighting a second battle: to maintain the liberal, enlightened, feminist ideals that I had held since childhood, against a powerful current pulling me away from them. I reminded myself, every day, that no, there's no conspiracy to make the world a hell for shy male nerds. There are only individual women and men trying to play the cards they're dealt, and the confluence of their interests sometimes leads to crappy outcomes. No woman "owes" male nerds anything; no woman deserves blame if she prefers the Neanderthals; everyone's free choice demands respect.

That I managed to climb out of the pit with my feminist beliefs mostly intact, you might call a triumph of abstract reason over experience.

But I hope you now understand why I might feel "only" 97% on board with the program of feminism. I hope you understand why, despite my ironclad commitment to women's reproductive choice and affirmative action and women's rights in the developing world and getting girls excited about science, and despite my horror at rape and sexual assault and my compassion for the victims of those heinous crimes, I might react icily to the claim--for which I've seen not a shred of statistical evidence--that women are being kept out of science by the privileged, entitled culture of shy male nerds, which is worse than the culture of male doctors or male filmmakers or the males of any other profession. I believe you guys call this sort of thing "blaming the victim." From my perspective, it serves only to shift blame from the Neanderthals and ass-grabbers onto some of society's least privileged males, the ones who were themselves victims of bullying and derision, and who acquired enough toxic shame that way for appealing to their shame to be an effective way to manipulate their behavior. As I see it, whenever these nerdy males pull themselves out of the ditch the world has tossed them into, while still maintaining enlightened liberal beliefs, including in the inviolable rights of every woman and man, they don't deserve blame for whatever feminist shortcomings they might still have. They deserve medals at the White House.

And no, I'm not even suggesting to equate the ~15 years of crippling, life-destroying anxiety I went through with the trauma of a sexual assault victim. The two are incomparable; they're horrible in different ways. But let me draw your attention to one difference: the number of academics who study problems like the one I had is approximately zero. There are no task forces devoted to it, no campus rallies in support of the sufferers, no therapists or activists to tell you that you're not alone or it isn't your fault. There are only therapists and activists to deliver the opposite message: that you are alone and it is your privileged, entitled, male fault.

And with that, I guess I've laid my life bare to (along with all my other readers) a total stranger on the Internet who hasn't even given her full name. That's how much I care about refuting the implied charge of being a misogynistic pig; that's how deeply it cuts.

You could respond to this, I guess, by treating me as just another agent of the Patriarchy trying at length to "mansplain away" his privilege. If you do that, then I'll consider this discussion closed, as neither of us will have anything more to learn from the other. But you seem like an interesting, reasonable person, so I hold out some hope for a human response.

Being a relatively shy male geek myself, I can certainly sympathize. Thankfully - though I certainly didn't see it that way when I was younger - I "came of age" in a comparatively rural, socially conservative area that just flat out didn't have time for such musings; if I was a teenager in a major urban area, I'm not sure I would have turned out all that differently, but, given the right inputs, I could see having some of the same concerns voiced by Scott above. I was being raised in Southern California, after all, until we made the move to Nevada in the mid-'90s.

That's not what I want to write about, though.

Let's flip the script around. Imagine you're a woman - there's about a 50/50 chance you're one already, so this probably won't be a tremendous leap of imagination. Let's further imagine that you're a young, reasonably attractive woman - this might take a bit more imagination, depending on your present circumstances, but work with me. Now, imagine you meet Scott before he gets himself established. What would that be like? If I had to hazard a guess, "cold" would be the first adjective that would come to mind. He probably wouldn't say much - if he found you attractive, it sounds like he'd be deathly afraid to say much of anything at all, lest he get labeled as a 'creeper' or something similar. So, he'll try to keep it professional to a fault, saying as little as possible and focusing solely on whatever is necessary to meet whatever academic or financial need brought you two together. Idle chitchat, needless to say, would be virtually impossible with him under these circumstances.

I know this because I've done this.

How pleasant would that interaction be? How much would you look forward to going to work with someone that was consistently cold and professional to a fault? Now, imagine if Scott wasn't the only one - what if, say, a third of the guys you meet in this field are like that with you? Or half? Or more? Could you imagine working in a world where at least one out of every three people you meet treat you like a particularly temperamental computer terminal, deathly afraid to say the wrong thing to you lest you 'crash'? Bear in mind that these guys won't just be coldly professional, either - a lot of them will be damned annoyed and angry with themselves for not being able to relax around you. What are their faces looking like? Are they wearing their anger and self-hostility on their sleeves?

You bet your ass they are.

Of course, this behavior doesn't just get directed in your direction - you also notice that it's being presented to every other young woman that walks in. Here's the kicker, though - if you're one of the women in those rooms full of men treating you and your fellow women with thinly-disguised contempt, you're not thinking, "Wow, these guys really don't know how to handle themselves around a young woman and really hate themselves for it." You're thinking, "Wow, these guys really hate women."

Which, to be fair, they kind of do.

At this point, if you're a young woman, you have a couple of choices. If you really like the field, you might stay in, shrug, and try to understand some of these guys. Who knows - maybe as you get older and less physically intimidating, some of these guys might mellow out a bit. If you don't - and, in your formative years, you probably don't like much of anything near enough to really suffer for it - you're going to find something else to pursue, like teaching or nursing - something that doesn't leave you surrounded by people that treat you with cold disdain and contempt.

Not surprisingly, most women will pick the latter option.

Now let's fast-forward a few decades. If most women pick the latter option, there will be fewer women in that field where a high proportion of cold, distant, somewhat hateful guys are located. This will cause a lot of somewhat better adjusted young men (well, at least around women), to reconsider their career choices as well - do they want to be surrounded by a bunch of depressed, anxious guys that treat women with thinly-veiled contempt, or would they rather do just about anything else? And lo, the business school receives another application. Meanwhile, the proportion of near-violently shy males to halfway normal, socially adjusted people in our hypothetical field adjusts just a little further to the shy.

Congratulations - we've just created a negative feedback loop. Moloch would be proud.

So, the question becomes, what do we do about this? It's obviously not in anyone's best interests - not the women, not the halfway normal men, especially not even in the interests of shy male geeks - to let this continue. If we do, several of our STEM fields, the vast majority of IT, and so on will be dominated by a bunch of shy, maladjusted men that can barely handle themselves, much less each other. If you think a lot of positive collaboration is going on in that environment, you're nuts. Do you think a room full of insecure people are going to reliably share credit with each other? Do you think a room full of insecure people are going to make bold, daring decisions with the possibility that they might be wrong? More importantly, do you think a room full of insecure people are going to talk themselves out of being insecure, or are they just going to share various anecdotes that reinforces everyone's insecurities?

And lo, Men's Rights Activists were borne.

Now that we've identified the problem, how do we fix it? It's not going to be easy - for whatever reason, our current society is effectively designed to sort everyone into narrow microcultures that get increasingly self-selecting and self-serving. Heck, the bulk of our modern information infrastructure is built by a particularly idiosyncratic and notoriouslyinsularmicroculture. So how do we get past it?

One possible solution that really doesn't seem to be working is ostracizing people whenever they say something we don't like. Whether you're talking about programming conferences or tech CEOs, branding people with Scarlet Letters of Shame that guarantee the denial of future employment forever and ever is just going to guarantee that everyone else is going to get increasingly cliquish and defensive. Sure, those insensitive Python programmers lost their jobs because of a bad joke, but do you think tech companies are more or less likely to bring someone in from the outside that might take offense to their "in jokes" after that? With Brendan Eich out, are we more or less likely to have homogeneous political views at the workplace, and what will that mean? If you're a startup led by politically conservative people - like, say, Paypal - are you going to take a risk, bring someone in from the other side of the spectrum, and hope they don't make a big stink on the TV when they disagree with you? Or are you going to raise the drawbridge and put people through various loosely scheduled social activities to check for "cultural fit"?

Oh. Right.

Besides, having one microculture point fingers at other microcultures and start chest-thumping about how they're soooo much smarter and soooo much more enlightened than the other microcultures won't break any barriers - on the contrary, that sort of behavior is explicitly designed to reinforce them. If we actually want to avoid STEM and their related fields from becoming yet another self-referential microculture dominated by a very self-selective group of people with very particular personalities, we need to encourage people to get together and talk to one another. This means accepting that some people have interests that we don't necessarily share and that's okay. This means accepting that some people laugh about things that other people don't find funny and that's okay[1]. In a lot of ways, it sometimes feel like our grandparents (or parents, or great-grandparents, depending on how old you are) understood this better than we do now, if only because they had to work together with people from different backgrounds to get through the Great Depression and World War 2.

The good news is all hope is not lost. There are still quite a few women in STEM, and still quite a few men who aren't interested in letting STEM settle into a morass of anxious depression and sexually frustrated rage. Wired recently had an article about the JoCo Cruise Crazy that I can't recommend highly enough, which detailed the outgoing-almost-to-a-fault attitude of the Sea Monkeys, along with the awkward behavior of some of the guys. Amazingly, everyone survived and had a good time and nobody had to walk the plank. Everybody more or less met each other halfway, learned where everyone else's boundaries were, found a thing or two in common to bond over, and made it work. We need a lot more of that right now, in STEM and in life.

**********1. That AFV is still a thing in the age of YouTube is absolutely mesmerizing to me, but I'm not going to laugh at anyone that watches it.

Sunday, December 7, 2014

For the past few weeks, I haven't been posting much because my attention has been diverted elsewhere. The picture above is a little sneak preview of what I've been working on, which is related to my previous efforts in solving Project Euler problems using Windows batch script - it's almost ready for me to share with the world (though, if you look around, you'll find it since I have it hosted publicly in the cloud), though there are a few i's I'd like to dot and a few t's I'd like to cross before I really promote this thing.

And what a thing it is! But I'm not ready to talk about it just yet.

Instead, I would like to talk about the general topic of Windows scripting. For years, my attention has been focused on small business IT - in that environment, there's a limited amount of automation available to the IT professional, at least as long as the customer is hosting their own equipment. Though a clever IT shop can probably find some way to leverage tools like Puppet and Chef to make on-site deployments more consistent, it's a little difficult to avoid treating servers like pets instead of cattle when each "farm" only has one or two "cattle" and the "farmers" don't like to share (to stretch the already overwrought metaphor a bit). In that environment, the limited nature of old-school Windows batch scripting - a language that traces its lineage all the way back to the early days of DOS - wasn't immediately apparent. Oh sure, there was the occasional heated discussion over whether it was more intuitive to suffer through RUNDLL32's myriad flags and byzantine syntax, or through VBScript's ridiculously verbose but at least sort of intelligible at a glance AddPrinterConnection method, or to just give up entirely and use KiXtart, but the results usually didn't matter all that much in the end. By the time you were done writing a script, testing it, and rolling it out, most scripts just weren't worth the time. So, every client would have a script or two with some "NET USE" commands, some clients with more dedicated IT professionals might have a slightly more complicated batch script with a control structure in it (I was notorious about this, though not near as notorious as some of my coworkers) and that was pretty much it. In our context, PowerShell was observed, tried out, and then promptly ignored as much as humanly possible - it took more typing than CMD, we couldn't count on it being on every machine we wanted to automate (it wasn't installed by default until Windows 7/Server 2008 R2), and it didn't do anything we weren't already doing for ourselves.

These days, though, I'm dealing with a somewhat larger environment. It's still not large enough to really see the benefits of PowerShell firsthand - we're talking about less than ten servers, virtual or otherwise, and approximately 250 PCs, more or less - but it's big enough where I can certainly imagine what a larger environment would look like and some of the challenges I would have keeping things halfway consistent and manageable. That's part of the reason I've been doing the Project Euler exercises in the first place - at some point, my scripting chops will need to be ready for a larger environment. While working on my exercises, though, I've run into some pretty serious difficulties - difficulties I've been able to overcome, mind you, but ones that definitely show that CMD is, shall we say, a product of its time:

CMD can't math. No, seriously, ask it what 2/3 is:

set /a _test=2/30

That's right - no floating point support. Decimals aren't a thing in CMD, and neither is rounding.

CMD's roots as a scripting language cutting its teeth in the heyday of BASIC really show. Functions are kind of a thing, if you're sort of creative about it, but it's pretty clear that they were bolted on well after the fact. There's exactly one loop structure - if you want a do/while loop, you're going to have to get creative with GOTOs and labels.

Delayed Expansion makes a lot of things possible - without it, I don't think I could functionally use a FOR loop or an IF statement in my Project Euler code. That doesn't mean it makes things easy, though. Divining the pattern between "the interpreter will interpret this as it's happening by default" and "the interpreter will just read ahead and only parrot back what the results will be after that loop is done" (General rule - if what you're doing happens between parenthesis, you probably want Delayed Expansion if you're used to any other programming language ever) is a royal pain.

You know what's awesome? When you can do things like this:

set /a _test=2000000000^2

And you get a result like this:Invalid number. Numbers are limited to 32-bits precision.

Arrays? They don't exist. No, really - they don't. Except... if you're really creative... and abuse Delayed Expansion a bit... you can kind of fake them, as long as you're only querying their values in a FOR loop. See, if you try to trick the interpreter out by doing something like:

SET _test0=FooSET _zero=0

ECHO:%_test%%_zero%

You'll just get 0 because it'll attempt to extract the value of _test (which doesn't exist), then the value of _zero (which is 0). However, if you do something like this:

FOR /L %%G IN (0,1,0) DO (ECHO:!_test%%G!)

It'll actually work, resolve %%G first, then resolve everything between the exclamation points as one variable. Spooky, eh? If it helps, the rest of CMD's syntax is every bit this consistent.

I don't expect a scripting language to have a firm type casting system - quite the contrary, in fact. However, CMD's is particularly... interesting. For example, let's say you want to calculate the elapsed time between the start and end of a script. Easy enough:

SET /A _mSElapsed=_mSEnd-_mSStart:: Insert conditional to handle occasions where _mSElapsed is negative because the script took longer than a second or it started near the end of a second.SET /A _SElapsed=_SEnd-_SStart:: Insert conditional... etc....

And so on. Well, if you tried to write the script like that and ran it, two things would happen:

Your failure to use Delayed Expansion when you called the %time% variable would result in the script always returning 0 since it would only query the value of %time% once - at the end of the script.

If any the time blocks (HH:MM:SS.MS) have a zero at the start (say, 12:09:14.54 - _MWhatever would equal "09"), CMD won't interpret the result as "9" when you ask it to do some math against it. Oh no. Instead... well, I'll just let Microsoft explain this one:

Numeric values are decimal numbers, unless prefixed by 0x for hexadecimal numbers, and 0 for octal numbers. So 0x12 is the same as 18 is the same as 022. Please note that the octal notation can be confusing: 08 and 09 are not valid numbers because 8 and 9 are not valid octal digits.

That's right - "09" suddenly becomes 9-base-8, which seriously doesn't exist and will lead to some fascinating results.

So, you end up writing a bunch of code like this to convince SET to, no, seriously, save the damned number as a base-10 number, please and thank you very much:

IF %_HEnd:~0,1% EQU 0 (

SET _HEnd=%_HEnd:~1,1%

)

IF %_MEnd:~0,1% EQU 0 (

SET _MEnd=%_MEnd:~1,1%

)

IF %_SEnd:~0,1% EQU 0 (

SET _SEnd=%_SEnd:~1,1%

)

IF %_mSEnd:~0,1% EQU 0 (

SET _mSEnd=%_mSEnd:~1,1%

)

IF %_HStart:~0,1% EQU 0 (

SET _HStart=%_HStart:~1,1%

)

IF %_MStart:~0,1% EQU 0 (

SET _MStart=%_MStart:~1,1%

)

IF %_SStart:~0,1% EQU 0 (

SET _SStart=%_SStart:~1,1%

)

IF %_mSStart:~0,1% EQU 0 (

SET _mSStart=%_mSStart:~1,1%

)

For those playing along at home, that's just a series of statements that say, if the first character in the variable is a zero, throw that zero in the trash can and just keep the last number.

Yeah. Now imagine having a thousand or so servers to manage and putting up with this. Given the utter lack of responsible error handling and the head-scratching syntax parsing, it's only a matter of time before somebody writes a script that they think checks a system's MAC address in a text file somewhere and uses netshto assign an IP address and computer name based on that MAC address, only to have it assign the same IP address to every system or just refuse to properly parse a MAC address' delimiters in some weird corner case that magically converts it into octal or hexadecimal or base 23.7 or Roman numerals or the numbering system of Mayan moisture evaporators or something. Compared to this, bash and its ilk must have seemed like a revelation to anyone even slightly seriously interested in server automation. This doesn't even get into how there are several corners of Windows that are virtually impossible to get to via CMD unless you feel like directly editing registry values with REG (given everything covered so far, what could possibly go wrong?) or you feel like stepping into the object-oriented nightmare that is VBScript[1]. Something needed to be done. Windows needed a proper, honest-to-goodness scripting language that acknowledged some progress in interpreted languages had been made since the first term of the Reagan administration.

I'm glad Microsoft took care of that, even if it's still something that remains mostly tangential to my day-to-day administration experience. For now.