hostess and britruby

November 18th, 2012

Apparently the British Ruby Conference has been canceled because people complained about the lack of diversity in their speaker lineup on twitter. It seems that the complaints prompted sponsors to pull out of the conference and hosting it was no longer financially viable. No doubt certain people will be angered by me saying this, but they’re the same people who are always angry with me, so I’m going to anyway: this totally reminds me of Hostess.

I’m immensely troubled by the idea that anyone who attempts an endeavor should be rewarded for attempting it, and that whatever steps they choose to take to make it a success, no matter how ill-informed, should be applauded simply because they are in service of the endeavor. That is goddamned nonsense. Your endeavor means shit without the risk of failure. Success is not a measure of your luck in managing to get it perfect the first time, it’s a measure of how well you deal with small failures and ensure they don’t turn into bigger ones or, even better, turn them into assets.

Apparently this is epidemic, this notion that suggesting anyone can do better is an attack on the very core of their character. Unlike our business failing or our conference shutting down, it’s not entirely our fault. We’ve been trained to think this way. Everyone gets a trophy just for showing up and all that. Nonetheless, that shit is poison.

I believe every person on the planet should drill this into their well-intentioned little noggins: every word of criticism is like a pound of gold. The more criticism you get, the greater your potential for success. And I do not only mean quality criticism. I do not only mean gently-worded criticism. I mean all of it. Here is my comprehensive and scientific breakdown, based on my own very important opinions:

kind, thoughtful, constructive criticism from your peers: OMG how did you find that? Pay that person to sit by your side through everything you do and never let them go because they are probably not actually human and in fact your guardian angel.
kind, thoughtful, criticism from outsiders: Easy to take, easy to ignore. In matters of marketing and perception, very useful. In matters of day-to-day operations, something to store in the back of your mind but probably not immediately act on.
nasty constructive criticism from your peers: The hardest pill to swallow, and probably the most crucial. If your peers feel you’re not listening to them to the point where they give up on civility, you need to pay attention and act fast. Do not dissemble. Do not argue about tone or motivation. Say this, even if it hurts every fiber of your being to be the bigger person: “Thank you for letting us know. We’re looking into it right away. If you have suggestions how we can fix it, we’d be very grateful.”
nasty constructive criticism from outsiders: Either a sign you’ve taken the above category too lightly, or a miscategorization of the type below.
nasty non-constructive criticism: Actually safe to ignore completely! If someone starts talking about your family, your appearance, or anything else unrelated to The Endeavor, they’re just trolls. HOWEVER. Do not mistake for trolls legitimately upset people who just don’t know how to get through to you.
criticism after-the-fact: Incredibly painful. If the channels of communication are no longer open so that you can make a meaningful response and it’s too late to fix anything, all you can do with that is improve next time, and that just sucks, valuable or not.

By now, you may have realized something: I am completely talking out of my ass. I have never run a bakery corporation or a conference and have put my highly scientific methods into practice in either context exactly zero times. That is a completely valid criticism. See how we’re all growing as people? I have, however, taken a lot of criticism, of all of those kinds. I’ve taken enough – and continued to solicit it – that I’m pretty good at recognizing which type is which. And while my personal successes are nowhere near the level of Hostess or BritRuby, every one of them is due to making mistakes and learning from them, just like everyone else’s. I’m saying this not as an expert but as a bystander frustrated at seeing opportunity wasted.

Nothing anyone does fails because people on twitter say mean things or workers go on strike. The failure begins long before those symptoms appear. It becomes terminal when they’re not treated with the respect that should be given any chance, even a last-minute one, to correct the situation before it all goes to hell. I see the same denial of responsibility in BritRuby’s cancelation announcement that I saw in Hostess’ insistence that their bankruptcy was due to workers demanding a living wage, and it upsets me. If you’re going to do a thing, do it. Don’t point fingers when it doesn’t work out. Any endeavor is an invitation to criticism, and any successful endeavor learns to benefit from it.

Finally, I have an example to make this all a little less vague. Over the summer I tweeted something about my disappointment in conferences that had one or zero women speaking. I didn’t call anyone out, there just happened to be a bunch of them on my radar at that time and I was like, “Still??” Pretty much immediately I got a tweet back from the organizers of LXJS saying that they’d asked all the women they knew, been repeatedly shot down, and did I have more suggestions or would I come and speak. A lot of people would decline an invitation like that because a lot of people don’t want any implication that they’re a token. I’m ok with being a token (somebody always has to go first), but it was their seriousness and sincerity that made me really want to be a part of the conference, and I’m incredibly glad I was because that same level of effort was evident in every aspect of it.

This is the crucial thing to me: my criticism didn’t mention them and they could safely have ignored it. Instead, they took it as an opportunity to say, hey, we’re frustrated, we tried everything we could think of and it didn’t work, and we genuinely want your ideas on how to do better. They sought out criticism. They engaged their critic and asked for the same level of responsibility for my statement they were taking for their conference. It impressed the hell out of me, and I hope anyone starting up a conference or anything else takes a look at LXJS and all the other brave organizations like it who seek out their critics and make them fans and tries to emulate that.

angelina jolie

October 16th, 2012

Happy Ada Lovelace Day! If you live under a rock, on Ada Lovelace Day you’re supposed to blog about women who’ve inspired you in STEM careers. And so you might be asking yourself, why the fuck are we talking about Angelina Jolie?

The answer, of course, is the seminal American film Hackers. Angelina Jolie plays Acid Burn, a 1337 h4x0r living in New York City. It was the first movie I’d ever seen Ms. Jolie in and thus, for me, she ever since has remained Acid Burn. I felt scared for Acid Burn when she was in the mental institution, and I was like fuck yeah when Acid Burn had to fight those mummies or whatever, and when Acid Burn settled down and stopped marrying strange men and became a UN ambassador and started adopting kids as a single mom cause fuck it, she wasn’t gonna wait around for some dude to help her live her life, I was like clearly this is what cool hacker chicks grow up to do. Not really. But kind of. Angelina Jolie’s career or life choices is not what I want to talk about, though. I just want to talk about that one role.

Here’s the thing about Acid Burn: she’s different than the female geeks we normally get in these movies. The first thing her character does in the movie is meet the nominal protagonist on a server they’ve both hacked into and completely pwn his shit. Ergo, she is the better hacker. But does that mean she’s some delicate little wallflower in a lab coat? Fuck no. She’s socially outgoing, an opinionated feminist, effortlessly cool, and (obviously) totally bangin’. She’s the type of high school girl who dates older dudes with motorcycles and throws killer parties in her mom’s apartment where she’s torn between wanting to make out with her dude and wanting to show her nerd friends her crispy-in-the-dark new laptop. Which is to say, a type of high school girl who has probably never existed, but the great thing is that as a high school girl watching the movie, you would not be aware of that.

The first rule Acid Burn breaks is being the smartest. The group of hackers featured aren’t even in the same league. Zero Cool, the protagonist, is ok, but he’s rusty, and he’s a total baby where Acid Burn is a grown-ass woman. In other geek classics, The Girl might be smart, but she’s never playing on the same field as the male protagonist. She’s at technical college, but she knits sweaters. She wears a lab coat, but she’s a psychologist who works with fuzzy bunnies. Not Acid Burn. She plays the same game and does it better.

The second rule she breaks is not being a victim. At the end, when the time comes to hack the Gibson, she’s right there with her nerdbros in her phonebooth. She is not the helpless executive with the easily-guessed password. She is not the foolish n00b who attracts the attention of the FBI. And, in contrast to Zero Cool, she didn’t spend her childhood banned from using a modem cause of some arrogant bullshit. She’s fully fucking profesh and she comes to the rescue of others, not the other way around.

The third rule is the most problematic, to use the vernacular, but is also central to the success of this character as a role model: she’s desirable. In Real Genius the hero is after some science groupie. In Revenge of the Nerds we’re supposed to root for the dude who tricks a hot cheerleader into having sex in a bouncy castle. If a nerd girl is going to be sexy, she has to fully realize the hot librarian stereotype, take off the glasses, shake out the updo, and shockingly reveal herself as physically beautiful. Acid Burn doesn’t get a makeover. She puts on a dress for some dude, but goddamn if he is not going to be subject to the same uncomfortable outfit. I think this is huge. Not only is she good enough the way she is, but she gets to be smart and capable and mature and the hottest girl in school. Teenage girls are full of little hormones. Telling teenage girls that to be a badass hacker you have to sacrifice your chance to get with Johnny Lee Miller loses you at least 85% of your potential audience, by my scientific estimation.

Is it shitty that we ask girls to consider their desirability before any of those other traits? Yep. But we can’t override years of social conditioning with a reasonable argument about a teenage girl’s inherent value as a person and right to respect herself. I think anyone who’s ever been a teenage girl, even one with a subscription to Sassy, can verify that for you. It sucks that the difference between Acid Burn and all those other nerd girls in those other movies is just that Angelina Jolie is gorgeous, and that it reinforces the idea that only beautiful women can do what they want. Ultimately, though, I’ll take one beautiful woman doing what she wants over lots of ordinary women being mostly ignored. And, frankly, the insinuations of the latter about women’s value is no less problematic.

The fourth rule Acid Burn breaks is being flawed. Though teenage girls might want to date someone in college, we in the audience all know it’s a mistake for Acid Burn to be with some motorcycle-riding douchenozzle who merely sees her as his little cheerleader when she could be hittin’ it with Zero Cool, who thinks she hung the damn moon. She’s the best hacker in the school, true, but she’s also pretty fucking cocky. And throwing parties while your mom’s out of town might make you feel cool for that evening, but come on. Those kids aren’t your real friends. She’s not the main character, but she still gets a real human personality, and even though the character is played by an adult, the mistakes she makes are ones a lot of kids could easily recognize as their own (although seeing them as actual mistakes might require the benefit of hindsight).

So those things. I was 14 and sitting in a small-town movie theater with a creepy older guy seeing those things and thinking to myself, I want to be this woman. Learning computer science will make me cool and boys will like me. It will give me some control over the world around me. If I become a 1337 h4x0r I will, in effect, become Angelina Jolie. At 14 I didn’t have any of the real, awesome role models I do now. I didn’t know one other girl who was into computers. I only started considering it many years later, but Acid Burn, in all her flagrant ridiculousness, was crucial in helping me envision a place for myself in this world.

These posts are, I think, supposed to be about real women, balancing real lives with often unglamorous work. I think I’m supposed to say that someone inspired me to find a noble purpose for myself and my talents (or, as I’d put it, my proclivity for breaking things down into sets of instructions). So this may be a little more real than I’m supposed to be, and it is not the most progressive thing I’ve ever written. But it’s honest. There are real women who did hard, under-appreciated work who instilled in me a belief that computer science was noble and beautiful and that I could be a part of it. They came later, though. I found them only because of an absurd fantasy of a female programmer. One that, at 14, I very much needed. She seemed like the right place to start. I’d like to thank Angelina Jolie for not portraying her as a passive sex kitten or a helpless wallflower, but as a Bitch Who Runs Shit. It’s legitimately possible that I wouldn’t be here without her.

you keep using that word

October 15th, 2012

I keep seeing the word “meritocracy” pop up, mostly in discussions that seem to have stemmed from Faruk AteĊŸ’ “A primer on sexism in the tech industry”. Do yourself a favor, don’t go googling. It’s the same shit:
“Sexism isn’t real because I’m a woman and no one did the sexism to me!”
“Women resent being treated as women instead of being evaluated solely on their capabilities!”
“You’re a sexist moron!”
“Some people called me a sexist moron after my moronic sexist blog post and it hurt my little feelings and I’m leaving the internet!”
“You GUYS, remember this is supposed to be a meritocracy.”

Except no. No it fucking isn’t. Because a meritocracy is not a real thing. It is a joke.

The word meritocracy comes from a political satire. It was never meant to be something we should aspire to. It was the opposite, actually, a warning about how we rationalize what we believe we’ve “earned”. If that sentence doesn’t seem to you applicable to the tech industry and our cyclical discussions about sexism, racism, and even occasionally classism, go get yourself another cup of coffee.

There’s some dumb bullshit in one of the current crop of reaction posts waxing poetic about “hacker culture,” and its freedom of speech and lack of PC dogma. Hacker culture was a bunch of white dudes. Hacker culture is a great example of a meritocracy. Some of the most privileged of the privileged got together and formed a community around the idea that they were smarter than everyone else. They created an arbitrary set of metrics for membership and according to their metrics, they triumphed. This was the first time in the history of the world white men had experienced the elation of peer recognition.

A meritocracy is not a system for locating and rewarding the best of the best. If it were, the “best of the best” in almost every goddamned industry or group on the planet would not be a clump of white men. I’m having trouble finding good stats on this, but white men are something like 8% of the world’s population. When you go to a fucking conference and you look around at all the white dudes, do you really honestly think, “Wow! What a bizarre fucking statistical anomaly it is that basically everyone with the special magic gift of computer programming happened to be born into a teeny tiny little demographic sliver of the population”? Of course you don’t. You don’t think about it. You focus on telling yourself that you’re supposed to be there, because you’re so fucking smart, and if other people were as smart or, if you prefer, they were “technically inclined,” they could be there just as easily.

A meritocracy is a system for centralizing authority in the hands of those who already have it, and ensuring that authority is only distributed to others like them or those who aren’t but are willing to play by their rules.

Somebody on twitter told me that when the computer industry was overwhelmingly female, it was due to merit. I think that makes a really good counterpoint to this meritocracy bullshit. Because no, it was not due to merit. Merit didn’t fucking enter into it. Most of those women had no experience in the industry and – even if we accept the lol-worthy premise that merit can be objectively measured – there was no way to evaluate their merit as computer scientists. That’s not to say we shouldn’t use that as a template. We absolutely should. Those women had jobs and were happy to have them. They worked hard. Those who stood out did so because they had demonstrated that their work was good (through their work, not through their savvy) and because standing out and advancing the field was necessary to their work. I would rather work with a roomful of those women than with the arrogant, privileged brats our industry too often recognizes “merit” in these days.

If we met the utopian ideal we toss around in blog posts, we’d still have lots of middle-aged women in this field. We’d have black people. We’d have Asian people – not a smattering, but a majority, cause the world is mostly Asian people. We’d have an even ratio of men and women. Because if there’s one thing I’ve learned after sixteen years in this career, it’s that if a middle-class white boy who literally never had a job before getting a sweet internship at some cutting edge technology company can eventually, through practice, become a passable computer programmer, anyone can do it. If there’s one thing I’ve learned after thirty-three years of being alive, it’s that if you see middle-class white boys flocking in droves to a particular career path, it’s a pretty fucking easy job and you should try and get yourself one like that.

I guess that’s a little mean. Sorry, middle-class white boys. I’m not calling you dumb. I’m calling you soft. I’m calling myself soft, also, and everyone else who works in this field. What a meritocracy really protects us from is challenge. If we don’t even allow most people through the gates, we don’t have to worry that we might pale in comparison to them (pun intended). There will always be a place for us in an industry we keep others out of. That’s why we should seek out diversity – because the lack of it makes us weak.

If you give a shit about this industry’s goals beyond making yourself look smart and cool, for fuck’s sake, stop calling it a meritocracy.

join the internet, see the world

September 4th, 2012

When I was hired by Chevron, it was to work in a brand new gas station they were building. Since they had a shiny new station, they wanted a shiny new staff to go with it, meaning that instead of just showing up and being told where the three-ring binders were kept, we spent a couple days attending paid training on their contents. The training was held in the small pastel conference room of the local Best Western. Every day at noon, we were given lunch. Free lunch. And we weren’t even really working! At 19, I was completely amazed by this.

I’m honored to be speaking at two conferences – Lisbon JS and JSConf EU – in the next month-and-some-change. I mention the Chevron thing because, in addition to the honor of speaking at any conference, it’s a big deal for me personally. I’ve left the continent I was born on exactly once. I’ve been on work-related trips, for conferences and general business stuff, but going overseas is a work-related perk I couldn’t even have fathomed 15 years ago, or even five. And I get to do it because I do this.

Working on the web is unlike any other sphere of development I’ve worked in in that we all have the chance to participate. People who speak at JavaScript conferences aren’t employees of the company that makes JavaScript; we’re all expected to make JavaScript. The distributed nature of this responsibility, and the context it pertains to, means that we don’t just share ideas with people in our region, or on the same continent. Ideas can come from anywhere, and they can travel anywhere, and if someone likes our ideas, maybe we get the chance to go with them.

I know a handful of developers who travel outside the borders of their home countries a bunch, but (as much as I hate flying) I wish more of us did that more often. Especially right at this moment, since I very recently saw one of the most inspiring videos I’ve seen in researching one of my talks: Trygve Reenskaug’s presentation “Object Orientation Revisited”. This is one of those things I wish like crazy I’d been lucky enough to see in person. This gentleman (the inventor of MVC) speaks with humility and humor about the fundamental philosophies that have informed the way a lot of development gets done these days, and it’s awesome. It made me remember what I loved about Computer Science way back when I was a student, and the sense that we are all contributors, not rockstars but scientists who can do no better than find a simpler explanation or a more elegant architecture. Seeing someone who does not fit the normal startup-y archetype speaking about things that affect all of us really drove it home for me: there’s a chance for anyone to make this field better, from anywhere, and for as long as they want to keep doing it.

So yeah. I’ll be in Europe in two weeks. I’ll travel to Paris, Marseille, Barcelona, Madrid, Munich, and of course Lisbon and Berlin. If you read this blog, I hope we’ll get a chance to say hello at one of the conferences. If you live in or have visited any of those cities, like I said, I’ve never been to any of them and would love some suggestions as to things to do and see (not the tourist stuff, everyday stuff that gives you a real picture of a place). And if you’ve never been to Europe, either, maybe you should start working on a talk, cause the world is full of good ideas.

sometimes community sucks

August 19th, 2012

My impression is that if you meet enough people in your developer community who are organizers of things – be they conferences, meetups, trainings, or anything else – you will at some point hear them bemoaning the fact that everyone hates them, or similar. I’ve listened to it several times. I’ve felt it (but kept it largely to myself) a few. Tonight I find myself, finally, in the unpleasant position of having evidence to back it up.

It’s generally understood that people taking on community organizer roles are just as flawed and prone to being wrong as anyone else, but are trying to do a good thing, and so we get given a lot of passes. For the most part – especially when the organizer in question is someone else – I think that’s a good thing. It’s difficult to put these things on, and nobody does it for the money, or even the fame, but out of a genuine desire to see their community grow and be better. I’ve learned over the past couple years to try and be delicate in my criticism of things other people organize, so it’s clear that I mean to suggest ways to improve an event or group, and not to criticize the efforts of the organizer, and certainly not to criticize the organizer as a person. Because over the past couple years I’ve become more aware of how hard it is not to take even the most gentle and well-meaning criticism to heart and feel you’ve failed.

If you’ve never done any organizing, you might wonder, so what if you failed? So you tried to do something for the community, and it didn’t work out, so what? If you’ve ever been on the other side, though, I think you begin to understand immediately. Before you even set up a website, or book a venue, or send out invites, I think most of us hesitate. There’s an element of impostor syndrome I think we’re exposed to at that point. I think a lot of us pause and ask ourselves, who the fuck am I to organize a _______, as though I had any authority on how a community _______ should be run? Maybe we wonder if someone famous shouldn’t do it, or someone with a really successful open source project, or someone who’s just, you know, better than we are. And maybe some of us stop right there because of that feeling. I spent years wanting to contribute in some way, not just with code, but to the community, before I was finally brave enough to start All-Girl Hack Night. It was that feeling that stopped me. So when someone tells you (what you hear as) you’ve done badly, you don’t just feel like you’ve made a mistake – you feel like a liar, a fraud, a snake-oil salesman whose arrogance has driven people away from the community, never to return.

So like I said, I am very much feeling that as I sit here writing this. I know that I failed at least one person, and may have caused them to become more skeptical about participating in a group I organize, and in other groups like it. I guess in a way I’m writing this blog post to myself, even though I started off writing it to all my friends who I know have felt this way in the past, or who are doing brave things that may expose them to this feeling in the future. Maybe I’m writing it to everyone in these communities. Maybe I’m just writing it.

You can’t make everyone happy. You just fucking can’t. Sometimes the well-intentioned approach that seemed great in your head, and worked great the previous three times, fails fucking abjectly. Sometimes someone is livid at something that other people begged for. Sometimes you meant it as a compliment and it gets taken as sarcasm. Sometimes you hang the banners and arrange the flowers and set out the chafing dishes and nobody ever shows up. We can try to make people happy, and to provide value, and that’s all we can do.

Bringing your A game isn’t always going to be possible. The more you try to do things, the greater the odds that you will fail at some point. That’s the risk inherent in trying. If there’s never been a time in your life where you were trying to make things work out, trying to get all the pieces to fit together, and yet could see that the situation was just rapidly falling the fuck apart, and all the people were rolling their eyes, and suddenly half your vocabulary disappeared from right off the tip of your tongue and you seriously considered just running out of the conference hall and into the nearest forest.. I envy you.

Anyone who gives up on a community because one organizer fucked up was probably already looking for an excuse. Sometimes people will treat you like the hostess at the Cracker Barrel. Those people have most likely not decided to jump into the community with both feet. And yeah, maybe you did have the opportunity to convince them to, and maybe you did waste it. That sucks. But it’s still ultimately a decision they have to make, to give the community permission to be wrong and to try and improve whatever they felt was lacking rather than just write it off as not worth their time. Even if you did the best job in the world, you still couldn’t be assured they’d come out of it that invested.

There are damn few institutions of community in this industry. The long-running conferences tend to be corporate things employees get sent to so companies can market to them. The long-running mailing lists get increasingly off-topic until finally they’re just slower versions of Reddit. I don’t think I know of any meetups that even existed before the mid-aughties. If you manage to make something hold together more than a couple months you are basically magic already. And, really, it’s better that way. We bring strangers together under the guise of community, and then we lose strangers to communities of friends they met while standing awkwardly at an open bar in a brightly lit hotel lobby wearing a plastic nametag. And if we organized that open bar, or even just the nametags, we have something there to be proud of. Attrition can bad, but it can also mean that it’s working.

Anyway, if you were wondering, hey, why is it that every community organizer I know gets so hilariously emo sometimes, I think I have your answer. We do this shit to do good and make things better, but there’s always the chance we’ll do a bad job, or even do a good job but still let someone down. That can make you feel really badly about yourself. Yet people still do it, cause if they didn’t someone else would have to, and then it would just sometimes suck for someone else.

etsy oauth in node

June 30th, 2012

If you take one thing from this post, let it be: never believe anyone who says, “Oh, it’s easy, you just use OAuth.” I say this because we were in a meeting talking about how developers in the JavaScript hackathon I’m at today would authenticate to Etsy’s API and someone, looking at the docs, made a similar statement. What I’m sure he meant was, “Oh, it’s easy, you just use this OAuth library.” The library in question, however, is in PHP. Luckily, there are similar libraries for Node, but they don’t work exactly the same and no one had actually written sample code to let developers use them easily in their projects.

In the past, I’ve dealt with OAuth by using Everyauth, which is awesome when it works. However, the past couple days when I looking into this, it did not work. I forked the project and ran npm install and discovered several problems (possibly because I’m using 0.8.0). I tried to get around them and create an Everyauth module for Etsy anyway, but I couldn’t get the damned thing tested so, though it looks right, I may never know if actually functions.

Everyauth is just a robust, consistent wrapper around another oauth module, however, so I didn’t have to code the back and forth and passing of tokens and all the nonsense entirely manually. (Which I started to do before I realized I don’t really have anything I need to punish myself for.) It was actually pretty simple to fix up a module using that to abstract the flow of getting the authentication token from Etsy, and probably would be the same for your site (assuming your site isn’t OAuth2 cause then I don’t even know).

create a skeleton module and make an oauth object

I actually started with all this crap in the server.js file and then moved it into a module once I knew it worked. Don’t tell anyone. But when I did that second, responsible step, this is what the module file looked like:

var oauth = require("oauth").OAuth;

var etsyAuth = function etsyAuth( key, secret, domain, callback ) {

    var that = this;

    return this;

module.exports = etsyAuth;

I guess that’s a pretty lazy module, but this is an academic exercise, and it gets the job done. The thing to note is that the only real setup necessary is including the OAuth module. That allows us to instantiate an OAuth object:

    this.o = new oauth(
        domain + ( callback || "/auth/etsy/callback" ),

Since this only has to work for Etsy, not every API under the sun, the host URLs can be hard-coded right in there, as well as most of the other initialization settings. The consuming app will obviously need to supply its own credentials, and might optionally change the route the application should redirect to once it receives the access token, but those are the only customizations offered. Well, that and the domain, but only because there might be some weird fuckers out there who intend to move their apps off of at some point.

consume the oauth module

It probably makes sense to look at how this gets implemented. I used Express, but mostly just for easy session management. Aside from the routes, this server just imports Express and the OAuth code I wrote and instantiates and configures the Express app and the OAuth object:

var express = require( "express" ),
    etsyAuth = require( "./lib/etsy-auth" );

var app = express.createServer(),
    api_key = "your key here",
    api_secret = "your secret here",
    entry = "/auth/etsy",
    callback = "/auth/etsy/callback",
    o = new etsyAuth(

app.configure( function(){
  app.use( express.cookieParser() );
  app.use( express.session( { secret: "example secret" } ) );
  app.use( app.router );
  app.use( express.static( __dirname + "/public" ) );

This has all been sort of copying Everyauth, but it diverges a little bit at the routes cause I feel like entry and callback routes are really a part of your application, and OAuth is just a thing that happens there. So the app creates those, and passes control to the OAuth module within the request handlers:

app.get( entry, function( req, res ) {
    o.getRequestToken( req, res );
app.get( callback, function( req, res ) {
    o.getAccessToken( req, res, function ( req, res ) {
        res.redirect( "/success.html" );

app.listen( 3754 );

In this case, the request handlers are both stupidly simple, but they could be doing data transformations, conditional templates, or generating Fibonacci sequences – whatever fits the needs of the application. They call two functions that are properties of our OAuth object, and the final bits of code I implemented/moved.

get some tokens

The first function, getRequestToken, uses the URL we provided when the OAuth object was instantiated and our API key to request a token, which is saved to the session object. Then the response redirects to a custom URL sent back where the user will approve our request to operate on their behalf:

    this.getRequestToken = function getRequestToken( req, res ) {
        that.o.getOAuthRequestToken( function( err, token, token_secret, results ){
            if ( err ) {
                console.log( err );
            } else {
                req.session.oauth = {};
                req.session.oauth.token = token;
                req.session.oauth.token_secret = token_secret;
                res.redirect( results[ "login_url" ] );

The next function is called once the user clicks the big “Authorize” button and comes back to the callback route in our app. It uses our existing request token and the verifier to get an access token, which gets saved to the session like the request token. If the application passed in a callback, we go ahead and execute that, and we’re done:

    this.getAccessToken = function getAccessToken( req, res, callback ) {
        if ( req.session.oauth ) {
            req.session.oauth.verifier = req.query.oauth_verifier;
            var auth = req.session.oauth;
                function( err, token, token_secret, results ){
                    if ( err ){
                        console.log( err );
                    } else {
                        req.session.oauth.access_token = token;
                        req.session.oauth.access_token_secret = token_secret;
                        if ( callback ) this, req, res );

If you want to see how it all comes together, it’s on github. Hopefully that’s useful if you need to authenticate to Etsy or setup OAuth for your own API.

ladies, speaking

June 16th, 2012

Between TXJS, which happened this week, and, it’s a good time to feel optimistic about women speaking at dev conferences. TXJS had something like six women speak out of sixteen speakers, which is a more impressive ratio than any other conference I’ve been to, and is trying to collect ways to make that a more common occurrence. Not too shabby, web developers. It seemed like a good time to reflect on the difference female speakers make, and maybe a little bit about how a female speaker might differ from a male one.

Obviously this is just my own observation and YMMV and all that, but seeing women speak is a big thing for me. And TXJS this year made me aware that’s it’s not only seeing women speak. Seeing them speak about their own projects and their motivations for their code makes me feel like open source is something I can do. That might sound disingenuous coming from someone who has participated a little bit in open source and has some of her own very small projects, but I am 100% serious about it and it was 100% needed. Watching women discuss projects that aren’t necessarily the biggest deal on github or used by everyone, but are nonetheless rigorous, important, and awesome made me feel like I can do those kinds of things too. I’d worry about leaning too far toward sexism in postulating as to why, but it’s different than seeing men do the same thing, and not just because I shared a gender with these speakers.

Actually, fuck it, let’s go ahead and postulate. While individual women are obviously as different as individual men, we do talk about how companies and industries can benefit from a more “feminine” way of conducting themselves. This means values that we associate with women and expect to see rewarded more in girls than in boys. Things like modesty, sharing credit, listening well and talking only when there’s something important to say, and sublimating our competitive drives when it’s to the benefit of a larger group. Things that we consider feminine traits are, broadly, things that place groups before individuals.

That’s what was so inspiring about these talks I saw. These women needed to solve real problems, so they quietly stepped up and filled that role of project maintainer when they created these projects. On larger projects, that role is almost always a man. Not only are these women capable of being brilliant developers (hopefully no one really needs proof of that anymore), but they’re capable of doing things women are often raised to leave to the boys. I was also struck by the way they spoke about their code, though. There was so little hyperbole, no sweeping dogma or expectations that the audience would automatically see why these projects were so cool. They carefully explained, and focused on the technical aspects. I can’t really explain it perfectly. It felt different. More academic. Less like someone was selling me something. Certainly I’ve seen men talk about their work this way, as well, but not very many. What would be really amazing would be if these speakers had inspired not just another woman with their approach to development and open source, but the men in the audience, as well.

With all that said, I found one thing wanting, and that was the technical nitty-gritty. While I loved seeing these women defend their work and think that happens in our communities all too rarely, I also wanted to see the code. I wanted them to scare me with their brilliance, and wow me with their code, and talk about how the use of this loop here instead of this switch there made all the difference in the world.

I know one of the things TXJS did to get so many ladies on stage was to invite less experienced speakers. That’s crucial for seeing more female speakers and changing gender diversity in general, because Rebecca Murphey and Lea Verou can’t be everywhere at once. I hope to see more of this, but I hope that conferences will coach these greener speakers, as well. It would be wonderful for conferences to send out a detailed sketch of their audience, even if it’s just the organizers’ best guess. (This would probably help female attendees feel more comfortable, too.) I think knowing that there will be people in the audience who’ve been to ten or more JavaScript conferences, for example, would make me feel more comfortable showing tons and tons of code, whereas if I thought the audience was likely to have only 1-2 years experience I’d want to talk more generally and limit the amount of code I showed. This only came up for me because I was dying to see these ladies’ code and I think last year when I spoke at TXJS I made a mistake in speaking too generally because I’d attended the conference as a serious-JS-n00b the year before. I can see how that cycle might kind of perpetuate itself without intervention from the organizers to get people to promote content at a certain level of detail. Standard disclaimer about having never organized a conference, though.

I hope people feel that coaching is worthwhile. Speaking from personal experience, it can be difficult to find the confidence to speak about something you’re still learning yourself, and even more difficult to feel like your own work is interesting. Knowing not just what to submit or prepare talks on, but what aspects to discuss and who to target the content to could potentially make a huge difference in getting new women speakers onto conference stages. Or maybe not. But bravo to the organizers of TXJS and all their speakers (male and female), and to the folks behind I hope these are signs of more good things to come.

answering the wrong question?

June 3rd, 2012

It seems like there’s a really good opportunity for someone to do something very helpful and make a site that compares and tracks JS frameworks. As far as I can tell, though, no one has, so maybe I can be excused for my ignorance if what I’m looking for already exists. What I’m looking for is a framework that deals with webpages as webpages, and deals with elements within an application as elements.

I kind of go back and forth on my feelings about MVC, but they average out right around apathetic skepticism, or ::rolleyes:: if you want. It’s because there are a shit-ton of them and MVC is pretty easy to write code for, cause things have these very clean relationships. That’s great for your data, it’s great for your backend, yada yada yada. But it’s pretty much shit for complicated interfaces. Views and models don’t always line up. Views without models exist and still have state. Some states are important to the application, some are important to a given object, some are important only to a widget. You can shove all the shit on your page into the MVC idiom – and people do – in order to use an MVC framework, but I don’t think that solves the real problem.

If you know of a framework that’s primary concern is with organizing DOM elements and DOM interactions, please stop right now and go down to the bottom and leave a comment telling me about it. As far as I know, such a thing doesn’t exist. jQuery’s great for working with the DOM, of course, but doesn’t make any attempts at organizing things or offering a hierarchy of objects. We now consider DOM interaction a bad thing, so more “serious” frameworks tend to shove the DOM stuff under the rug, deigning to interact with the page only when necessary.

I don’t want to say a bunch of shit I’ve said before here, but that’s just fucking silly. Structuring your code around abstract objects instead of the mechanisms by which things are actually made available and manipulated – DOM elements – is like having a perfectly organized closet while the rest of your house looks like something from the TV show Hoarders. It’s low-hanging fruit, and it skirts the issue that’s the most difficult to deal with and the most inseparable from the idea of a web application.

I’ve looked at a bunch of these frameworks. I’m not going to lie, I’ve only attempted to write apps using a few, and quickly got frustrated by the tradeoffs between limitations and simplifications they were offering. You don’t have to agree, but I’m just saying: I’m a computer science major, one of not very many I know, and I find their approaches way too computer science-y. Writing an interface programmatically is one of the most painful things I’ve ever had to do (repeatedly, in VB), and that’s what the frameworks I’ve worked with all devolve to once you’re beyond the tidy CRUD model where MVC can give you genuine shortcuts. But, again, I’d love to know if I’m missing something.

I read a blog post about how fashion designers should learn to code recently and was kind of horrified by it. To me, it’s a perfectly example of why not everyone should learn to code. Not because the solution was bad – I think polaroids are about as elegant as you’re gonna get, personally – but because part of how a programmer has to train himself or herself to think is this kind of obsessive, examine the problem from every angle, think of every possible optimization pattern. We do need people who can think that way within certain contexts. It’s useful when you’re building an application. Or, say, a JavaScript framework. But it can and does bite us. We know what happens when we’re wandering around unchecked with a hammer looking for things to use it on. (We use it inappropriately.) I feel like it’s time to stop letting classical CS patterns inform the way we build JS frameworks and embrace the way the DOM actually works and is used and has been used, and build around that. When someone truly does that well, I think JavaScript will take another big leap forward, and we’ll all wonder why it took so long for us to address the right problem.

what the fuck is an entrepreneur

May 31st, 2012

I swear, if I read one more thing about how lucky we are to have so many entrepreneurs in Austin, I’m going to scream. This week has been especially annoying, what with a tone-deaf video promoting a group called We Are Austin Tech and an article gushing about a brand new pro-entrepreneur clubhouse in the middle of downtown. You could be forgiven for thinking, based on these media sources, that all it takes to build a thriving technical business is a plucky entrepreneur and a dream. Not exaggerating. Some choice words of wisdom from the video:

“We’re actually creating the future. And if it wasn’t for entrepreneurs, it wouldn’t get created.”

If that quote right there isn’t enough to keep you from going to work for anyone who calls themselves an entrepreneur then I don’t even know what the fuck.

I’ve made a decision not to work with or for anyone who self-identifies as an entrepreneur. It’s a little arbitrary, yes, because there are some good ones who’ve boldly decided to lump themselves in with the dickbaskets, but I trust myself to know when to make exceptions. But in a community that rewards people just for hanging that mantle on their little noggins, the term loses credibility across the board. Here’s why:

1. I make things. I want to work with people who make things.

My major problem with entrepreneurs under the current definition is that the only thing they appear to “make” is personal wealth. They move capital between entities, they buy low and sell high, they’ve created a very crafty way of purchasing “talent” (or, as we used to call them, people). And this makes them rich, and it makes investors rich. Unfortunately, all the cycle usually leaves in its wake is second-hand IKEA furniture you don’t have to figure out how to assemble yourself and a pile of XS and XXL branded t-shirts. These things don’t have to be tangible, but they do have to be valuable to everyone using them, and useful in their own right. Otherwise you’re not creating anything, you’re just using technology to skim a little off the top.

2. I want to invest, too.

I’m not talking about money. I’m talking about my time, creativity, credibility, and anything else I have to offer as a developer. I’ve been at companies where I always had one foot out the door because no one there seemed super interested in the long term feasibility of what they were doing. I find that waiting-around-to-get-bought feeling gross. It’s what I imagine it must be like to be inside one of the cartoon suits as Disneyland. You spend all day putting on this performance and then you go home and spend your paycheck in some dive bar, wishing your life had some meaning. Or maybe people really like working at Disneyland, I don’t know. But working for a company that discourages or disregards your effort fucking sucks.

3. I am not a prize to be won.

The other problem with companies whose end goal is to get bought is that as an employee you’re literally a commodity. My understanding is that the itemized bill of sale for a startup is like:
14 – office chairs, Aeron
18 – laptop computers, Macbook Pro
5 – laptop computers, Macbook Air
2 – engineers, database, good health
3 – engineers, front-end, questionable health, cool haircuts

And if you think even making this a bullet point is silly, know that I’ve worked for more than one entrepreneur who literally collected engineers, doing nothing with them except maybe attempting to use them as bait to lure in other engineers, and at worst treating quality developers like office decorations. In the end (if you stick around) you get treated like a medieval princess and married off to Facebook even though you’re in love with Tumblr.

4. I want to work for people who know what a dollar’s worth.

The thing entrepreneurs seem to be really good at is acquiring money. Once they have it, though, they seem to be confused about what to do with it. I’ve known more than one to spend lavishly, then suddenly realize they’re burning through a lot of cash, dial it down, then get frustrated by what happens to morale sans both interesting work and a fully stocked kegerator, so attempt to recover by spending wildly again. The problem is, that’s fucking stupid. Not only is it wasteful for the business and a tiring cycle to be trapped in, it doesn’t accomplish what it should. It takes a confidence I associate with non-startups to pay employees the highest salary the business can afford and trust them to see through the more gimmicky competing offers they might get elsewhere.

This isn’t exclusive to entrepreneurs, but I also become suspicious when someone tells me, “We’re going to make you a really good offer.” That’s like the “high-roller” at the restaurant who, midway through an evening of boorish behavior and nursed bottom-shelf cocktails, assures you you’re going to be “taken care of”. People who know the value of the service you’re providing will demonstrate that in the only way that counts. Anyone trying to get you at a discount or on spec is deserving of your skepticism. Entrepreneurs still looking for that “first round” can fall into that category. I’ve had people seriously try to negotiate my salary expectations way down with, “but we’re a startup!” The fuck do I care if you’re a startup. All you’ve just told me is that you’re not my future employer.

5. A person who believes in their business identifies themselves by their business.

Calling yourself an entrepreneur instead of “CEO of Internet Fabulous Products, LLC” is like going to a party as your spouse’s date and introducing yourself by telling people what a good kisser you are. If you don’t take your company seriously enough to tell people your job is running that one company, why should an employee or anyone else take it seriously? And if you’ve always got one foot out the door, ready to sell, fuck over your employees, and move on to the next company, who’d expect the next company or its complement of hapless employees to fare any better?

6. People with no technical knowledge don’t belong in the technology industry.

It’s not enough just to have a good idea. If your good idea has a shitty implementation, other people will be along soon to eat your lunch. And your good idea will have a shitty implementation if the person in charge doesn’t know a single thing about how it should be implemented. It’s not merely laughable when a “technical entrepreneur” has no technical knowledge – it’s offensive. I’ve worked for businesses all my life. I don’t call myself an executive. If you merely use technology as a means to end, rather than creating technology, fine, you get a pass. But if what you’re creating is technology, if the limitations of hardware or software have any bearing on your design decisions, if there’s ever an installation, configuration, or download step, and you don’t understand it, I don’t want to work for you. Who built Facebook? Who built Google? Who built Microsoft? Those people, whatever else you want to say about them, deserve to call themselves technical entrepreneurs. By comparison, there are a large number of entrepreneurs barely competent to call themselves middle management.

Here’s a quote from the article I linked to at the beginning:

“The No. 1 challenge for tech startups in Austin and around the country is hiring critical engineering talent,” Baer said. “We are going to bring the best talent here for all these events we will be having.”

The best talent, huh? That’s a pretty big promise. Maybe it would be easier to bring in the best talent by publicly showing a little more respect for the work that they do, and a little more modesty about using other people’s money to purchase other people’s skills. Maybe there’s more than one of us who wants to work for a technically skilled boss who’s building the business he or she wants to grow old at and gets their hands dirty right along with us – not just another self-styled “entrepreneur”.

giving greenfield stuff to newbs

May 22nd, 2012

I’m coming up on two months at my new job (feels like a lot less), and with the amount of code we have, that means there’s still plenty I haven’t seen or worked with. There are certain processes (e.g., deploying) that have become automatic, but others I haven’t yet done. I still get automated emails and have no idea what the hell I’m supposed to do with or about them, if anything.

No matter how far along you are in your career, integrating yourself into a big system takes some effort. Flexibility and lack of process in a smaller system usually speeds things up, but it can be hard to deal with in a bigger system, maybe because it’s hard to trust that there aren’t hidden processes or toes to step on in some part of the system you haven’t stumbled into yet. I had a thought about how it’s easiest for me to deal with that uncertainty, as well as to work toward becoming familiar and overcoming my newbishness; I wonder if anybody else feels the same. I kind of think that, maybe against all sense, the best thing an employer can do with a new employee – especially in a big engineering group – is give them a greenfield project.

I’ve almost always started out fixing bugs. Tiny, trivial things. A couple of pixels of missed padding, some content tweaks, an IE6 issue half the team has looked at and no one’s been able to reproduce. Dude, that shit is frustrating! Not only do I spend sometimes entire days just trying to find the code I’m looking for to insert debugger statements or whatever, and have to learn how things are built on the backend and what the organization is, but once I finally do that, all I have to show for it is a paltry and brainless task that someone familiar with the codebase could probably have completed in five minutes. Conventional wisdom is that this is how you become familiar with the codebase. I’m not so sure, though. I think you become familiar over time, as you gain context. The patterns become predictable to you. You know that one of these three people will have worked on it, so it will be coded and organized one of these three ways. But your time to learn those things is measured in months, not tickets closed. Trying to hurry it along, I think, may be fruitless.

Contrast this with a small greenfield project. You’re still going to need to touch a hell of a lot of code. You’ll still have to go exploring, and learn the little bits of style guide that evolved from an oral history of alert()s and never quite made it into the wiki. But instead of leaving breadcrumbs through a confusing maze as you try to fetch a pebble, you’re building a tiny monument using the stones you find closest to you. And you may do it wrong. It’s almost certain that something about the task won’t match up with the standards of your new employer. But then you can have a code review, and hear about those standards in context, while you have an open buffer to save them to. Having a project composed of tasks, instead of a project with a single incidental task, gives you a place to begin and a way to attach more meaning to the structures and processes you discover.

I don’t think I’ve ever started and been given a greenfield project. Or maybe I have, but without understanding that they were truly mine to take ownership of. It hasn’t mattered as much at the past three places I’ve worked, since the code was so much more segmented, and there was less to learn. Here, though, with one pretty substantial codebase, I’m finding that I really want a home base in all of it to start exploring from. Do other people feel like that when they’re starting out somewhere?