Encouraging Female Programmers, Even the Redheads

On my last post, someone named Bob didn’t like that I’d said: “NYU did not have any sort of club for women interested in CS.”

Did they have a general CS club? If so, they had a club for women interested in CS.

Having special clubs just for women (or just for men) hurts women by making them seem different and an “other”. We don’t have special clubs for red-heads in CS for the same reason.

I joined NYU’s general CS club. When I walked into the room, there were 20 guys and me. I almost turned and left, but I thought, “Fuck it, if I’m not supposed to be here I’ll stick like a limpet and do better than all of them put together.” However, I don’t think most people have the “If people want me to do X, I’ll do !X” attitude. I know that if I didn’t, I wouldn’t be in programming.

Being the only woman in a room full of guys makes me feel “other,” not having a special club. It’s nice to having a club that’s all women so that there’s somewhere to do go when I don’t want to feel other. If being a redhead made me feel other, maybe I’d like to spend time with other redheads in CS, but it doesn’t, so I don’t.

I met a guy a couple of years ago who didn’t think women were “naturally” good at computer science. He thought this because his college’s weed-out class had started with 100 students, three of whom were women, and none of the women made it through the process of whittling the class down to 20 students. Being the only woman in the room feels like I’m representing all women: if I fail, I’m showing that all women everywhere aren’t good at CS. Sometimes it’s nice to not have that burden.

Further Reading

If you’re interested in why women don’t enter computer science and what can be done (I find the subject fascinating), check out these resources:

How to Succeed in CS Without Really Trying

How-to-Succeed-in-Business-Without-Really-Trying-Broadway-Poster

When I was in college, I was a pretty mediocre student. I knew that my grades weren’t going to get me a great job after graduation, but I had read that doing research with a professor was looked on favorably. I wasn’t particularly interested in research, but it was the lead I had.

I went to my advisor and asked her if I could do a research project with her and she was delighted. A few weeks later, she invited me to a “Women in Science and Engineering” event she was organizing at NYU. It got my brain churning and, as I walked home along the south side of Washington Square Park, I suddenly realized that NYU did not have any sort of club for women interested in CS. I’d love to say how I altruistically thought such a club would encourage more women to pursue CS, but honestly I just thought that would look fantastic on my resume. I quickly sent out an email to the CS students and founded a club. Thus, Women in Computing was born (as a side note, it is still flourishing and doing good in the world, so that’s something).

After that, I saw an advertisement that Google had a scholarship to attend the Grace Hopper Conference. Well, with my research project and being the founder of Women in Computing, I was a shoe-in. The conference was my first tech conference and I was wandered around in a haze of free pens and teeshirts, asking companies about summer internships. At the Goldman Sachs booth, the woman took one look at my resume (research, founding Women in Computing, winning the Grace Hopper Scholarship) and offered me an internship on the spot. I accepted.

When I got back to NYC, I saw a poster for the big fish: Google’s Anita Borg scholarship. I applied for that and, thanks to all of my prior accomplishments, won. This helped me win an award for my research and an NSF grant for grad school, which all contributed to me getting into every PhD program that I applied to.

So, it turned out that doing a research project with a professor was pretty good way to bootstrap success, although perhaps not in the way it usually works.

Velocity 2013

I’m going to be signing books at Velocity Conference on Tuesday, October 15. You can find me at the O’Reilly booth from 10:50-11:50.

Last time I did a conference signing, O’Reilly had a stack of free books I had written and they just gave them out down the line, although you had to have me sign it. So, all in all a pretty good deal!

If you’re coming to the conference, stop by and say hi!

Using Visual “APIs”

I’ve worked on a couple of games in my free time now and each time I learn more about how to make the graphics look polished. Assuming that, dammit Jim, you’re a programmer, not an artist, here are some tips:

Choose a Theme

Come up with the concept of your game: is it going to be dark? Cheery? Avant-garde? Grungy? Sleek? This will inform all of the other choices you make. Make sure you can actually do the style you’re aiming for, though. For example, I love the “vintage grunge” look with lots of flourishes and distressed textures, but it takes me hours to make anything with that style, so I don’t.

I wish I could turn this store into a video game.
I wish I could turn this store into a video game.

Choosing a Palette

Having a color palette that you use throughout your game gets you 90% of the way to looking good. However, creating a nice palette is difficult. Fortunately, designers have this covered for you. Go to Kuler or Colour Lovers and browse the popular palettes. Choose something that fits your theme.

Even if you think you want everything in your game to be greenish, choose a palette with at least two contrasting colors (e.g., green and blue don’t count, green and purple do).

A difficult palette to use.
A difficult palette to use.
This is an easier palette to use.
This is an easier palette to use.

You’re only allowed to use these colors. In particular, do not use black or white, those “expert mode” colors. If the palette doesn’t have anything light enough or dark enough, use the Hue/Saturation/Brightness sliders adjust the Brightness slider until it’s a better shade. You’ll be amazed at how the darkest color starts reading as “black” and the lightest as “white.”

Note: make sure you’re allowed to use the palette, and of course credit it appropriately.

Rolling your own palette

If you want to create your own palette, check out the Final Boss Blues tutorial. It shows you how to create a nice combination of colors, even if you’re not artistically inclined.

Get a Nice Font

Google Fonts is the best source I’ve found. If you’re doing something not-for-web, you can download the font as a .woff and then use a converter to make it a “normal” .ttf (make sure you have rights to use it that way, yadda yadda).

By using these pre-built visual resources, I’ve found it’s a lot easier to make something that doesn’t look terrible. Good luck!

The Professor, the Interviewer, and the Coworker

I once interviewed a guy who was pretty good, but not a definite “yes-hire-him-now,” which was what 10gen was looking for. He was a bit careless and indifferent and I’ve noticed that when someone can’t keep their personality quirks down in an interview, they’re not going to suppress them once they’ve been hired. (Which is fine for many quirks: programmers are a quirky lot, but not some, e.g., constantly interrupting or getting angry about being disagreed with.)

A professor who knew both me and the interviewee was disappointed. The professor thought the student was the bee’s knees: they had been a brilliant student. He couldn’t believe 10gen would pass up such a great catch. I was sad to hear this: I really respected this professor’s opinion, so maybe we had passed on a great thing.

The tech scene in NYC is not that big and this guy went on to join my friend’s company. I was curious about whether I had made a mistake and asked my friend how the new guy was. He was brilliant, my friend said, no doubt about that. However, he didn’t really seem interested in the work and didn’t get much done. When he did program something, he wouldn’t test it, he just assumed it would work and left the “cleanup” of actually making it functional to his coworkers.

It’s interesting how different work is from school.

Smart Pointers and Heirloom Underpants

batman

I’ve seen a lot of descriptions of scoped_ptr and unique_ptr, but often they don’t give clear examples of when to use one vs. the other. Hopefully this will clear things up.

unique_ptr is like an heirloom ring: you might purchase it, have it all your life, and end up being buried with it. For example, something like:

void Human::Life() {
  std::unique_ptr ring(new Ring());
  // Leaving the scope is "dying" and the ring is destroyed
}

However, you could also pass it on to a child. For example:

void Human::Life() {
  std::unique_ptr ring(new Ring());
  // Allocates a new child on the heap that will outlive this
  Kid *kid = CreateChild(this, GetSpouse());
  kid->Inherit(ring.release());
}

Now the parent’s life can end and the ring will survive.

On the other hand, scoped_ptr is more like “my underpants will die with me.” There is no passing them on. The intended use is something like:

void Human::Life() {
  scoped_ptr underpants(new Underpants());
  for (int i = 0; i < 1000; i++) {
      SendToCleaners(underpants.get());
  }
}

You might lend them out, but you retain ownership. Say you try to pass it on anyway with something like:

void Human::Life() {
  scoped_ptr underpants(new Underpants());
  Kid *kid = CreateChild(this, GetSpouse());
  kid->Inherit(underpants.get());
}

At the end of Life(), the underpants will be destroyed and any pointers to them will now point to garbage. Which makes sense, since they’re pointing to a dead guy’s underpants.

Finally, there’s shared_ptr, which is more like your award-winning chili recipe. If you tell a bunch of people about it then you’re sharing ownership of the chili recipe. Eventually all of you will die and the knowledge will be gone but you don’t know who’s going to the big chili pot in the sky in what order, so the data isn’t destroyed until you’re all gone.

The Rise of Big Data

I was helping a MongoDB user with sharding one time. His chunks weren’t splitting and I was trying to diagnose the issue. His shard key looked reasonable, he didn’t have any errors in his log, and manually splitting the chunks worked. Finally, I looked at how much data he was storing: only a few MB per chunk. “Oh, I see the problem,” I told him. “It looks like your chunks are too small to split, you just need more data.”

“No, my data is huge, enormous.” he said.

“Um, okay. If you keep inserting data, it should split.”

“This is a bug. My data is big.”

We argued back and forth a bit, but I managed to back off from having called his data small and convince him it wasn’t a bug. That day I learned that people take their data size very personally.

Upcoming Hackathons

A couple of interesting hackathons are coming up:

  • October 4-7th: Ludum Dare October Challenge – The challenge is to monetize a game. Win the challenge by earning $1. You can monetize a game you’ve already made (or make a new one).
  • October 11-12th: Tizen Hack, an in-person jam in NYC for making an app for the Tizen app store. I’ve never heard of it before, but it was done by the Linux Foundation and supports HTML5 or C++ for app development, so it sounds interesting.
  • October 11-13th: Asylum Jam, where the goal is to create a horror game that does not use mental illness or psychiatry as a source of fear. Nice Halloween-themed game jam for a good cause.

Busy month!

Edutainment

Bjarne Stroustrup gave a talk on C++ 14 and beyond at Google a few weeks ago. The part I remember best was:

If you got Microsoft, Apple, and Google together in a room to discuss how to implement C++, that would be collusion and illegal. But if Microsoft, Apple, and Google are on a standards committee, that’s public service.

I recently read an interesting article about how, although Ted talks seem to teach you more than a boring teacher would, you don’t actually learn more from them. This isn’t quite true for tech talks: the smaller and more interactive the talk, the more you can learn. However, larger, more impersonal talks are more like entertainment.

Most talks at conferences are, or would be better for being, entertainment. People can’t learn that much from a talk anyway, so why not get them all fired up to learn more about the stuff on their own? A keynote or lecture at a conference should be technical, but should also engage the audience and get them excited. Conversely, a coworker explaining a concept to a half-dozen colleagues will fall pretty squarely in education.

Ludum Dare

This weekend, I participated in Ludum Dare, a game programming competition where you make a game in 48 hours. Here’s the final result:

Screenshot of the action

And the source, including all images and music: https://github.com/kchodorow/ld27. Incidentally, it worked out to 48 commits over 48 hours.

If you’re registered, please try it and rate my game.

All in all, this was so much fun. I thought it was really cool how much I could make in 48 hours (I can basically implement Candy Crush in two days!). I found it surprising how much art even a really simple game took (I ended up on “New Document #87” in Inkscape by Sunday… I at least started 87 pieces of art!). There were some “this is held together with spit and glue” moments (particularly Sunday afternoon) but I don’t think there are any game-stopping bugs.

Things that worked:

  • Named constants for everything, with good names. Taking the extra couple seconds to create a constant for everything kept saving my ass.
  • Making so much crap global. At first I wanted to carefully pass around just what I needed but then I just gave up and made almost everything global.
  • My level class. I ended up being able to crank out a nice variety of levels in a few minutes.
  • Using music from http://www.nosoapradio.us/ was a huge time saver. I just plopped in an awesome free MP3 and bam, atmosphere.
  • If you win Dirty Rotten Seconds, the little duelist floats off into the sunset. It’s subtle and most people probably won’t notice, but the effect made me happy.

Things I would do differently:

  • Spend some time the first night working on a deployment script. I ended up with something that sort of worked, but deploying was always nerve-wracking and I ended up with all sorts of unnecessary junk uploaded.
  • Not make a game with people in it unless I’m using someone else’s assets. I hate making art assets for people, and I kind of committed myself to making 12 of them for this game. I was dreading taking care of it all Saturday.
  • Start out by adding lines every 100px on the screen. It would take 20 minutes, tops, and would have saved me endless frustration over where things were being placed/aligned.
  • I need to work on my animation skills. I’m not sure what free tools are good for 2D animation, but Inkscape isn’t it.

Overall, I wish I had had the time to make it more of a strategy game and less of a twitch game. Also, making levels turned out to be so easy I wish my theme had allowed 50 levels or so.

The competition ended at 9pm last night, so afterwards Andrew and I were trying out other people’s games. Some people came up with some really neat stuff. Some of my favorites so far:

And now I have 1500 new games to try out! Pretty amazing.

On the downside, I feel like I didn’t get much of a weekend. I had a lot of fun, but I’m starting the week with my brain and hands all tired.

Still, it was an awesome experience and I’ll definitely be participating the next Ludum Dare!