From now on, I’m calling it GroovyString

I’ve been doing a lot of introductory Groovy presentations lately, and an issue keeps coming up that I feel I have to address. I’ve had to think hard about how to do this, though, because I don’t want to be misunderstood. I’m probably going to fumble it a bit, so please forgive me if I ramble.

Lately there have been several episodes in the IT industry of boys behaving badly. A recent article in Mother Jones has a good summary. In short, a few guys in this industry have had a tendency to do and say things that have been particularly insensitive to women, for a variety of reasons ranging from simple foolishness to (potentially) outright bias.

Maybe this isn’t terribly surprising. After all, geeks aren’t always the most agile of social butterflies, and one of the downsides of getting guys together in groups is that the collective IQ tends to be lower than the individual ones. Still, I don’t want to rant about that, especially since lamenting poor behavior is almost as much of a cliche as the behavior itself.

Instead, I want to focus on the Groovy programming language, and a decision made during its early formation that could easily have been avoided if more women developers had been available.

As anyone who works with Groovy knows, the language has two types of strings. One uses single-quotes ('this is a string') and represents and instance of regular old java.lang.String. The other uses double-quotes ("this is a string with a ${variable}"), and allows for variables to be interpolated into it. The latter is a really useful class and comes up all the time.

By all the standard conventions, the class representing double-quoted strings should be called GroovyString. There are thirty or forty different classes in the Groovy API that start with the word Groovy, including such common classes as GroovyObject, GroovyShell, GroovyServlet, and GroovyTestCase. A GroovyString class would feel right at home there.

Unfortunately, though, the original development team decided to call the class representing double-quoted strings GString, because they thought it was funny. Even worse, since you substitute values into it using a $, the inevitable follow-up joke is that you do string interpolation by “putting a dollar in a GString”.

Now, I’m sure no malice was intended at the time. It was a joke, and I chuckled the first time I heard it too. So have many women I know when they first hear it. It’s actually a pretty clever joke.

But that doesn’t mean a name like that belongs in the standard library.

I think of it this way. The name of that class is yet one more reason why we need more women in this field. I’m sure that if a woman had been part of the core Groovy team at the time, she would have said something like, “ha ha, very funny, guys, but let’s not hard-wire that gag into the standard library, okay? You know, the same library that’s going to be used by every Groovy developer ever?” I fully expect that the rest of the team would have thought about it and almost certainly (if sheepishly) agreed. After all, it’s the kind of joke that’s funny once, and only for a few minutes. After that it’s mostly a nuisance. It’s hard enough to get a language named Groovy taken seriously by the Fortune 500 without going there, too.

Please don’t get me wrong, though. I’m not blaming or condemning anybody. That’s the sort of gag that comes up all the time. The mistake was making it part of the standard. Clearly there wasn’t a woman available at the time to provide some perspective.

I also draw a strong distinction between silly mistakes and outright bias. Everybody makes mistakes. I make them all the time. I try not to say anything offensive in class (or in life), partly because I really do try to respect people different from myself, and partly because I’m pretty much of a coward and don’t want to get in trouble. I certainly don’t want to make anyone uncomfortable for no good reason.

Oversensitivity leads to its own problems, too. I was an undergrad at MIT back in the 80’s. Despite the popular image of the place, the actual male/female ratio there was about 55%/45%, which wasn’t all that bad despite my complaints at the time. (The women there used to joke that the ratio of “acceptable” men to women was closer to 50/50.) The women at MIT tended to be pretty strong personalities, too, which I always thought was a good thing. I’ve always welcomed the company of women I could take seriously, or men too for that matter. The problem was that like so many academic environments, MIT had a marked tendency to overreact to any accusation of bias. Once someone complained of bias, rationality went out the window and any hope of getting to the actual truth was completely lost.

By the way, I believe this is partly what happened in the late 80’s and early 90’s, when oversensitivity to bias was labeled “political correctness” and summarily dismissed. I think we’re still paying the price for that.

That’s really unfortunate, too, because every woman I’ve ever met, without exception, has a story to tell that qualifies as bias or even harassment by any reasonable definition. Sometimes all you have to do is ask to hear stories that will make you shudder. Overreactions desensitize people against actual injustices that should cause outrage.

I don’t think the Groovy class in question qualifies on that scale. It’s a mistake, in my opinion, and a natural result of having too few women in the field. I’m not calling for a movement to rename the class or criticize anyone who uses the established name. But, then again, I’m not a woman. It’s entirely possible I don’t “get it”.

As a result, from now on I’m going to call double-quoted strings GroovyStrings. It’s easy enough for me to do, and while it may not change anything, hopefully it will make some women developers feel slightly more welcome. If you want to join me, great, but if not, that’s fine too. I’ve made my decision, though, and hopefully this post will make my reasons clear.

About Ken Kousen
I teach software development training courses. I specialize in all areas of Java and XML, from EJB3 to web services to open source projects like Spring, Hibernate, Groovy, and Grails. Find me on Google+ I am the author of "Making Java Groovy", a Java / Groovy integration book published by Manning in the Fall of 2013, and "Gradle Recipes for Android", published by O'Reilly in 2015.

5 Responses to From now on, I’m calling it GroovyString

  1. nagaimasato says:

    Funny. I never knew “GString” was joke. Nice post!

  2. maggieleber says:

    Well, it is kind of funny. And I note that there are G-strings for men too.

    That said, I’m for orthogonality in naming, wherever possible.

    Just as long as there isn’t a graphics primitive called “GSpot”. 🙂

  3. There is a saying in spanish: el que tiene hambre, en pan piensa. It roughly translates to: he who is hungry thinks of food.

    It never ocurred to me to think of GString as a g-string. It is the first time I’m seeing the analogy with the $ placeholder also. What I’ve seen lately is people getting offended by proxy. I assume GString is insulting to all women, so by proxy I will stand up for them in protest of GString.

  4. Ken, I’m sorry but I still find this funny even though you said it would wear out eventually! I grin every time I interpolate a string. Maybe I need to grow up a bit or maybe when I’ve worked with Groovy as long as you have it will bug me too. I agree that we shouldn’t be sexist but I think if we worry too much about being PC nothing will be funny any more. On the other hand having it in the API is a talking point and I know a few friends who went and had a look at the API after I told them about it, so it’s not totally a bad thing.

  5. Erm … first the inventors of Groovy are french. Second, I never heard the term g-string before, I doubt there was any joke or anti women bias involved in calling the Groovy strings GStrings.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: