Best Practices: Java Function Signatures

[Note: most of these examples use the Guava open-source library; I highly recommend it.]

Say I have a Java function that takes a bag of objects, does some processing, and returns another bag of objects. I could naively write the function like this:

public Foo[] process(Foo[] inputs) { ... }

This is obviously terrible, but let's talk about why it's terrible. First, we've constrained the input to be in the form of an array, which is an inflexible data type used only rarely in Java. Most callers will have their data in a collection of some sort and will be forced to call .toArray(), which is a waste of CPU and memory. The return value is equally bad - arrays are not first-class collections in Java, and in order to do any interesting additional processing they're going to have to do an explicit conversion using, say, Arrays.asList() or Arrays.stream().

Let's look at a slightly less bad version of this function:

public List<Foo> process(Set<Foo> inputs) { ... }

Now at least we're using Java collections. List<> is a useful collection and might do all of the things the caller is interested in doing with the result (but we'll get to that later).

Let's consider the parameter. The function is asking for a Set<>. Why? Does it need a collection of possibly unordered, unique Foo objects? Or does it just stream() them or iterate through them and not really care what order they're in? If that's the case, then why are we requiring passing in a Set<>? The answer is probably we created this as a helper function and the caller was keeping the data in a Set<> so we just copied that. But there's no good reason to require a Set<> if a more general type would suffice.

Likewise, let's consider the return value. Our function probably generates a list of objects internally, so just returning a List<> is fine. But List<> doesn't really tell us anything about the kind of list we've generated. Is it mutable? Immutable? The caller might need to know whether it needs to make a copy of the list to make changes to it! In these cases, especially if we're returning an immutable collection, we might want to make that specific to give our caller a heads-up!

One more time, this time even better!

public ImmutableList<Foo> process(
  Collection<Foo> inputs) { ... }

public ImmutableList<Foo> process(
  Iterable<Foo> inputs) { ... }

Both of these are perfectly fine. I tend to prefer passing in Iterable<> since it's more general and allows for lazy-evaluated sources, but Iterable<> isn't supported by Java's native for-each loop and getting a Stream<> from an Iterable<> requires the more complex call:

Streams.stream(inputs)

Rather than just:

inputs.stream()

So go with whatever you're more comfortable with.

There's still one thing more we can do to improve this, however. Note that the above requires that the Collection<> or Iterable<> be of a specific type. But in the case where we might have polymorphic objects, there's no reason the collection couldn't be of a child type - the function should be able to handle it all the same. So, let's finish with the best possible version of this function for an arbitrary class Foo (if the argument is a primitive type or String we shouldn't do this, though):

public ImmutableList<Foo> process(
  Collection<? extends Foo> inputs) { ... }

public ImmutableList<Foo> process(
  Iterable<? extends Foo> inputs) { ... }

And there you have it! The perfect function signature.
Have fun and happy coding!

State of the Dana - Fall 2016

So I've written a bunch of angsty-ass stuff in the past couple three years, and nobody should be surprised, since existential dread is basically one of the four trans girl food groups (the other three being prescription drugs, knee socks, and glitter).

Well, good news, everyone! No more trangst for Dana!

I had my last major(-ish) surgery in August - body contouring - and it's pretty much cleared up the last of my dysphoria. Electro is winding down, too; I no longer need to go for an hour-plus every week. I'm officially off spiro barring a huge T spike, so no more constant trips to the bathroom. Last (and certainly not least) dilation is down to less than once a day, so it's not eating my life anymore.

Even better than that: our first child is due in March and I'm getting ready to breastfeed, I've been given a management position at work, and I've joined an honest-to-goodness roller derby team.

I'm officially sticking a fork in my transition: for all intents and purposes, it's done. I'm a girl now - a big, gay, bad-ass mama tech bitch on wheels, to be precise.

Y'all better get the hell outta my way.

On Persistence

♫ Hercules Mulligan
I need no introduction
When you knock me down
I get the fuck back up again ♫

-- Hercules Mulligan, Hamilton

This past Sunday I went to my first official Rat City practice and got my ass kicked.

When I say I got my ass kicked, I don't mean a bunch of big scary girls beat me up - though I'm sure that's gonna happen at some point. No, I did it to myself. We ran pyramid sprints between two sets of cones with a toe-stop at each end - there, there-and-back, there-and-back-and-there, all the way up to eight segments and back down to one.

Note: I suck at toe stops.

The whistle blew. I ran out, turned, and wiped out. Then I got up, sprinted, turned, and wiped out. Then I got up and did it again, and again, and again. I think I ate shit about ten times over the course of the drill, landing hard at least three, but I got up every time, dusted myself off, and finished. Some of my stops even looked half-decent by the end.

I could have quit after the first hard fall, or the second, or the third. I was slower than everyone else. I looked like a complete tool in front of everyone.

But I wasn't about to let a bruised body - or ego - stop me from finishing the practice. We went on to other stuff that I sucked less at, but I think I made my point. I was the new girl; I wasn't very good yet, but I was persistent.

...

Transition is pain. Trans girls don't tell you this very often, mostly because we don't want to draw attention to the fact that we're trans, but transition is pain. Emotional pain, yes - dysphoria, isolation, humiliation, the full brunt of our emotions after having testosterone to dull them our entire lives. But also very real physical pain.

I dilate twice a day for 20+ minutes a pop. I jam a series of hard plastic wands into my vagina to stretch the skin and keep the scar tissue from contracting. The sensation varies from merely uncomfortable to excruciating.

I do electro every week. If you've ever gotten a tattoo, imagine that, but on your face, for as much as four hours every week for literally years (I think my record was ten hours in one week). And you have to do genitals for about a year too if you're gonna have bottom surgery.

I've been under the knife for a total of 12 hours, with months and months of recovery after each go.  I've had my face literally taken off and put back on again. I've had my genitals sliced, diced, inverted, and stuck back in me.

I did all of that because my choice is to give up and die, or grit my teeth and endure. I endure.

Nothing that happens to me in derby can be as bad as having my first wife turn on me after ten years together. Nothing can be as bad as losing my home. Nothing can be as bad as four hours of electrified needles in the face every week for a year. Nothing can be as bad as being constantly misgendered. Nothing can be as bad as the recovery from bottom surgery; as three days of lying flat on my back with nothing to eat or drink. Heck, nothing can be as bad as shoving the big dilator in and twisting when I'm already raw from that morning and exhausted and would rather just fucking pass out.

None of that shit ever made me give up. Nothing in derby can, either.

...

Transition is pain, but it's also time. We give up lives and relationships we've built over the course of years. We spend time away from work on medical stuff; we spend time away from our lives recovering from surgery. Even mundane stuff like dilation is a huge time sink - at one point I was spending three hours a day just on that, and it's still close to an hour.

I've had to start my life again in my mid thirties, with fewer hours in my day because just being trans takes up so much damn time.

I don't have the luxury to stop and take a breather every time I fall down. I don't have the luxury to be able to sit and nurse my bruises, or to skip a practice. I don't have the luxury to do anything other than go at full speed, all of the time, even if that means that sometimes I fall down hard.

Don't be surprised to see me fall. Just remember: when you knock me down, I get the fuck back up again.

Goal-based AI in Red Faction: Guerrilla

I'll sometimes talk about the stretch of time between being in graduate school at Illinois and coming to Virginia. It was possibly the second most tumultuous segment of my life (after this past couple of years), when I dropped out of my PhD program, got married, and got a chance to work in electronic entertainment for the first (and probably the last) time.

I signed on with Volition, Inc. (now Deep Silver Volition) in fall of 2005, when the original Saints Row was deep into production and Red Faction: Guerrilla was struggling to make it out of its pre-production phase. I was one of two (and later, three) programmers assigned to create intelligent AI for the latter game - AI that would be able to function in an open-world, destructible environment! It wasn't an easy task!

The senior engineer on the team had already come to the conclusion that we should using goal-based, backward-chaining classical planning for AI, because FEAR had had so much success with it in the FPS genre already and we were doing a third-person shooter (albeit not on rails to the same degree as FEAR was). The precedent set by FEAR was simple: AIs had simple goals (find the player, kill the player) and sequences of actions that could achieve those goals (hide, step out of cover, snipe, ambush), each with its own animation or animation cycle. In the earlier parlance of game AI, each state became an action, and instead of having rules governing state transitions we had freeform action plans with the only requirement that they be the simplest way to achieve a goal.

But just having goals and actions available wasn't enough. We needed a more sophisticated system that modeled how people in a fight actually might behave.

The first piece: percepts

We realized early on that a lot of the goals a person might pursue in a combat situation are informational. What's going on? Is anyone over there? I hear gunfire, but where are my enemies? In order to choose whether to pursue an investigational goal or a combat goal, we needed AIs to have internal mental state about their beliefs. And the way AIs formed beliefs was through percepts.

Percepts were typically audio (hearing footsteps; hearing gunfire) or visual (seeing a civilian or enemy). Sounds were easy: we tagged every sound a PC or NPC could make with a radius; other NPCs would hear the sound if they were within that radius. Some sounds were obviously signs of combat (explosions, gunfire) while some weren't (footsteps). When an NPC heard a sound, it created one or more beliefs along the lines of "explosion over there!" "strange footsteps in my building" "somebody's hurt"- and these beliefs would decay over time.

Percepts - especially those linked to line-of-sight - could be very expensive to calculate, and so we put all requests to perform eye raycasts (how we had to determine line-of-sight, since our geometry was destructible and we couldn't have pre-baked LOS calculations) on a queue. The delay between any particular NPC requesting a raycast to the player (or anyone else) and actually getting it tended to only be a few frames, but along with the planning delay it tended to nicely simulate the time it would take a normal person to react to something new in their field of vision; AI did not have that weird property of reacting immediately to being able to see you.

The second piece: orders

For military units, orders were a second big part of the puzzle. Orders consisted of things like "guard this building", "guard that person", "patrol this route", "kill the enemy". These didn't normally affect which goals were available (though they could, for things like guarding and patrolling, which were also goals) but tended to limit what actions were available to NPCs.

For example, until a building was destroyed, NPCs assigned to guard it would almost never consider an action plan that required them to leave. This prevented the problem in older games of monsters hearing the player and then all streaming out the door so the player could pick them off one-by-one. Instead, guarding NPCs would pick actions like "go to sniper point" or "go to a window that provides cover" or "search the building".

The third piece: goals

Goals tended to be simple, and fell into a few categories. Examples were things like "guard this building", "patrol this route", "get to safety" (for civilians), "investigate a disturbance", "dodge enemy fire", "find the enemy", and "kill the enemy". AIs would attempt to form a plan to achieve their highest-ranked goal, then if that failed, they'd drop down to their next-highest priority.

Since only a limited number of planning passes were allowed each frame, sometimes AIs would spend a small amount of time idling before they could generate a new plan. To smooth this over, we baked in some reaction animations so that it looked like they were thinking/looking around before they started running off to the next objective.

The ability to fall back to a lower-priority goal also meant that if we were actively preventing AIs from achieving their goals, they still did something sensible. For example, we limited the number of enemy NPCs who could engage the player at once on all but the highest alert levels; more distant NPCs would fall back to goals of observing the enemy or guarding. Also, it was possible that it might not be possible to fulfill an investigation or attack goal without violating the NPC's orders, in which case being able to fall back to "guard" or "escort" was important.

The final (and most fun) piece: actions

Once a goal has been chosen, an AI will try to string together a sequence of actions that takes the NPC from their current condition to the goal state. For example: if an NPC wants to kill the player, an available action might be to shoot the player from a vehicle turret. If the NPC is not on a vehicle turret, however, the NPC must first man the turret. In order to man a vehicle turret, the NPC must be in the vehicle; if they are not, they must enter the vehicle. And they cannot enter the vehicle unless they are adjacent to a door, which might require going to the vehicle. (You'll also notice that each of these is only a single animation sequence or cycle; that was by design as it gave us both a good action granularity and obvious points to blend between animation states.)

Of course, a much simpler plan of action is just "shoot the player from where you're standing". Each action has a "cost" associated with it, which may be variable (traveling further costs more). The plan the NPC can find with the lowest cost is the one they try to perform. For example, an NPC standing out in the open may dive out of the way, do a dodge roll, or duck into cover in order to avoid incoming fire; ducking into cover is the least expensive so if the NPC is already in cover they will almost always do it - unless the incoming projectile is explosive and they'll be caught in the blast, in which case they'll pick one of the more expensive options (typically diving, since it gets them out of the way the best). Likewise, an NPC in the open can run to cover, but it's usually cheaper to just dodge.

Evaluating whether an action is possible may require some computation in itself; for example, in order to perform a melee action, the NPC must be able to pathfind to a location adjacent to their target, within 2-3 feet of the same height, and have a clear line-of-action to the target from that location. That's a pathfind and a short raycast, which is non-trivial in cost. For these actions, we may delay planning a frame if our AI budget has been used up, and if it turns out that the action is untenable, we may prevent evaluating it again for a period of time (usually at least several seconds). That way we don't waste compute cycles evaluating actions we know aren't going to apply to the current situation.

Multiple action plans = emergent behavior

That kind of heuristic logic actually led to one of my favorite bugs during development. There are wild people living out in the Martian desert in RF:G called "Marauders" - kinda like the sand people on Tatooine in Star Wars - who use a lot of melee weapons and have Mad Max-like vehicles. I had a test level set up with a crowd of Marauders, one of their vehicles, and a couple of structures including a ramp. I ran my PC over a ridge at the top of the ramp, expecting a mob of Marauders to swarm me with their melee weapons, but instead, a couple of guys jumped in the vehicle, drove up the ramp, and ran me down!

The reason was that there was a bug in the melee heuristic that was comparing the difference in height not at the endpoint of the move-to-melee action, but at the start, and since the Marauders were all at the bottom of the ramp, they immediately discounted melee as a possibility and fell back to the much more complex plan of "go to car, get in car, drive to  enemy, run over enemy" to satisfy their "kill the bad guy" goal. That's exactly the kind of emergent behavior we wanted from AI in the game, and despite the fact that it only showed up in that case due to a bug, it was still an amazing proof of concept.

Anyway, it's hard to explain how the thing worked in any more depth without actually experiencing the game, so why don't you go do that? I'm sure it's cheap on Steam...

We need women everywhere - even on Wall Street

A friend recently shared this rather unpleasant NYT article on social media, which sparked an interesting discussion about workplace sexism. One commenter said he couldn't feel bad for these women because - well, I'll let him use his own words:

The woman in the story leaves the bank after five years, ending what might have been a "brilliant career on Wall Street." What often constitutes a "brilliant" career on Wall Street seems to me to include the sorts of predatory, irresponsible, and morally bankrupt strategies that are often condemned by outside viewers. I don't mourn the fact that someone was prevented from participating in that business and culture.

It sounds like a valid viewpoint. Wall Street is bad; we should be focusing on dismantling it instead of trying to make the cadre of exploitative assholes who run our financial system more diverse. But I also strongly disagree for a couple of reasons.

BN-AA343_Deutsc_F_20131016143336
Wall street women; possibly also exploitative assholes? (source)

The mere presence of women changes business culture.

We know from empirical evidence that companies with women on their boards make more money. Women take fewer ill-advised risks than men and generally outperform men in investing, which you'd imagine wold be a useful thing on Wall Street!

Maybe the toxic, wasteful, and destructive culture on Wall Street is partly due to the fact that it's largely populated by entitled frat boys with nobody to tell them they're being assholes? I can't promise that more women (and PoC and other underrepresented folks) in high finance will fix all of the things that are wrong with it, but integrating the trading floor is a way easier way to start than burning the entire system down (however appealing that might be).

Having women at the levers of power matters.

This is the other big reason that integrating Wall Street is so  important. Wall Street holds a lot of the levers of power in the modern world. Women being largely excluded from Wall Street has a trickle-down effect in everything from who gets elected to national office to whose startup gets venture capital funding.

It's all well and good to say, "Screw Wall Street; women shouldn't even want to work there!" but the reality right now is that Wall Street being dominated by white men contributes to white men also dominating business, politics, the high-tech sector, and many other important and arguably more virtuous segments of our society.

The argument ultimately boils down to the tired old "boys will be boys".

We tend look at these kinds of stories, throw up our hands, and say, "Well, what did they expect?" It's the exact same dismissal we see when women complain about their treatment in everything from the military to competitive video gaming. And it's wrong.

esports-have-all-the-things-spor-640x360
eSports Guy prefers his gaming with a heaping side of testosterone

When we tell women not to bother working or playing in male-dominated arenas, not only are we complicit in limiting their career options but we also implicitly condone unacceptable behavior by men everywhere.  When Silicon Valley bigwigs hold important meetings at strip clubs; when women aren't invited on business trips because they'd "ruin the mood"; whenever a woman is subjected to behavior that's dismissed with "boys will be boys" or excluded because otherwise men would have to behave themselves like adults - these all damage our ability to succeed and advance in the workplace.

You can't just isolate the problem and hope it will go away. There is no place where sexism is acceptable, and we should not - cannot - allow men to carve out places where it is.

Even if that place is the hive of scum and villainy that is Wall Street.

The Plight of the Sport Utility Girl

(a meditation on being a woman trapped in a trans woman's body)

Igor Stravinsky's groundbreaking ballet Le Sacre du Printemps (The Rite of Spring) was one of the first large orchestral works to break the mold of Romantic composition. It freely ignored notions of tone and meter that had dominated Western music for centuries; flouted rules even the most avant-garde of composers had previously only had the temerity to bend.

The first public performance ended in a brawl.

I am not an English horn

That's an interesting story, but we'll save it for another time. I told it in order to tell you this one: the score itself starts with a solo by a double-reed instrument. Most people hearing the work for the first time would assume it's being played by an English horn or even an alto saxophone. It's actually a bassoon, playing in the extreme upper register, in such a way that it sounds nothing like the instrument is supposed to. It's also painfully difficult for all but the most accomplished bassoonists to perform. A common joke among musicians is that the lyrics for the solo are: "I am not an English horn - this part's too high for me - I am not an English horn!"

Most people assume that when I speak, my voice is higher because of hormone replacement. Many will comment that it sounds low for a woman, whether or not they know I'm trans. In reality, HRT doesn't affect the voice at all. Before my transition I sang bass and had a speaking voice below the normal range for most men; now I'm having to push myself up to the very top of my range to even read as androgynous.

To paraphrase Samuel L. Jackson in Pulp Fiction:
The truth is, I'm a bassoon, but I'm trying real hard to be an English Horn.

(Also, like the Rite of Spring, I am constantly reminded that any of my own public performances have the potential to end in a brawl.)

Right panels, wrong frame

There's a story about the origin of the sport utility vehicle in the U.S. The car-buying public wanted something sexier than a station wagon; sportier than a minivan. Car manufacturers were in a bind - they could design such a vehicle, but it wouldn't pass the fuel-economy standards of the time. So they figured out a way around those standards: build a car (a station wagon, really) on a light truck chassis, so that it would only have to follow the (much less stringent) emissions requirements for trucks.

The new Frankenstein creations were big and muscular with lots of cargo room, but they were effectively just cars with bigger tires and a higher roof-line. They burned more fuel, were more prone to tipping in tight turns... and people loved them.

One of the challenges with transitioning later in life is that the older the body, the less malleable the flesh is. Facial features become more masculine, shoulders get wider, and cartilage fuses into bone. A woman transitioning in her early teens goes through puberty normally as a girl and (post-SRS) doesn't look any different naked than her cis peers. If she transitions in her late teens or early 20s she'll be taller, with masculine facial structure and broader shoulders, but she'll also have decent breasts and hips. After that... well, it's a crapshoot, but don't expect too much body remodeling without the intervention of a good plastic surgeon.

That's where I am, of course. I'm basically an athletic, teenage woman wrapped around a 30-something dude's skeleton. I'm a car on a truck chassis - a Sport Utility Girl.

Flip this body!

And that's something I struggle with. In an ideal world, getting my hormone balance right would be enough to put me at peace with my body. In the real world, I need to pass as female in order to be able to function in society.

Since my facial surgery, makeup and the right clothes can get me most of the way there. So I can go out in public, interact with other people, be gendered correctly the vast majority of the time, and basically just live my life. More than that, I'm in a stable relationship with a person who likes the way I look even with my clothes off.

If all of that is true, why am I still unhappy with my body?

There's a few reasons I can think of:

  • It's hard for trans women not to see their old bodies in the mirror, even after big changes
  • I'm somewhat limited in what I can wear and still maintain a feminine silhouette
  • I'm not as appealing to as wide a range of potential partners as I could be (I'm in an open relationship, so this is still relevant)
  • It's hard not to compare myself to other women; I know I'm an outlier in terms of body shape and it's hard to be different even if that different isn't necessarily bad or unattractive
  • I'm attracted to women, so I'm constantly evaluating my body in terms of what I personally find appealing

It's that last one that sucks the most. It sucks because it plays into the old canard of "autogynephilia", invented to erase gay trans women. It sucks because I know that some of the things I like in other women's bodies are also things they might hate (we're all taught to hate our bodies to one degree or another). It sucks because I'm the last person who should care how I look since I can't actually date myself, and there are plenty of queer girls out there who find me attractive and who are willing to date me.

It sucks because I have the means to fix pretty much everything remaining that's "wrong" with my body if I want to, so the temptation is always there.

Mostly it sucks because I want to love my body. Most days I do. I'm tall; I'm strong; I've got cool hair and - since the surgery at least - I'm not all that hard on the eyes. But I don't love my body every day. Sometimes I can't not think about the ways it's failed me; how if I'd only known in high school or college I'd have been so much closer to my goal with so much less work. And I don't know what to do about that.

I just want to be happy. We'll see if I can find that happiness inside myself. If not, what's a few more hours under the scalpel, right?

Rant: "Female-Identified"

I realize the term "female-identified" was created to be an umbrella term for cis women and people in various parts of the trans* spectrum; as perhaps the broadest-possible category of people who aren't men or agender. I also kind of hate it, and the more I hear it, the more it grates on me.

This is not even a request for people to stop saying/writing it. It's just a chance for me to try to express why it bugs me.
female-symbol
So... "female-identified" - let's unpack that. First we have "female". Which is biological sex, not gender. I mean, I'm a woman. Am I "female"? What does that even mean? Sex is a constellation of biological features - it's chromosomes, hormones, primary and secondary sex characteristics. I am decidedly androgyne right now. I'm moving towards female as hard as I can, and if we're going by the preponderance of the evidence, I should be there shortly if I'm not already. But "female-identified"? That's just weird.

It seems that the phrase "female-identified" is reaching for something else. It really wants to be about the identification; to be an umbrella term for those who see themselves on the female side of the gender spectrum regardless of the accident of their birth. We're searching for something that covers all people - cis, trans, nonbinary, bigender, whatever - who see themselves in and want to occupy some or all of those roles; who are othered and excluded by the patriarchy; who are members of some kind of greater Sisterhood.

Fortunately we already have a word for that group: "women"

If you want to be very inclusive, you could say, "women and nonbinary people", "women, nonbinary, and AFAB people", etc. (The choice of whether to include trans men in women's spaces and activities is an interesting one and far too complex for me to deal with here.) Or you could just say, "not men", which is also perfectly fine.

Adding "-identified", IMO, unnecessarily separates cis and trans in a way I'm just not comfortable with. It calls out being inclusive in a situation where inclusivity should sort of be implied. It's icky.

On the myth of the "10x" engineer

A lot of people have been talking about "10x engineers" and how "important" they are to things like software development. People want to put forward the idea that hiring the "right" developers (almost always white or Asian, male, from specific colleges or with specific pedigrees) is the key to making your company successful. And yes, hiring good people is important, but this "10x" stuff is complete bullshit. Let me tell you why:

Teaching + Teamwork > Raw Productivity

Assume for a moment I can get 2 or 3 times the work done that an average employee can. That's great! Now what do you do with me? If you put me nose-down in code for 40 hours a week, it's like hiring an extra person. Still great! Except that I cost the company almost as much as two junior engineers - so... not so great.

Now, what if I spend half my time teaching, mentoring, reviewing code, working with the members of my team to make them better. Say that after a year I've boosted each of their performance by a mere 25%. But then I've still put in my 100% (instead of 200%) and on a team of five the other members have contributed another +100%. But if they've learned something, that's a permanent upgrade that doesn't go away if I stop mentoring! So next year, our team gets +300% if I just write code... but maybe also if I continue to help them improve, and then the following year it's 400% instead. So on, so forth, etc. - and the company still reaps the benefits if I leave!

Combine that with the dearth of minority mentors and role models in the industry and I am far more valuable as a force multiplier than I am as an extra-productive engineer. I say that the same goes for all of these "10x" or whatever people - the idea that people can be judged only on the volume of their work output is silly and counterproductive in the long term, both for the companies they work for and the industry as a whole. Better to judge them on how much more productive they can make the people around them.

Or to put it another way, a "1x" engineer is only a liability if you're not willing to help them grow in their career. I'll take a "1x" who's willing to learn and works well with others long before I'll hire an antisocial "pro" (and have, by the way - it was a good choice).

And now, a sportsball analogy:

Consider the Boston Red Sox and the New York Yankees. The Yankees have by far the highest budget in MLB. They can (and do) buy all of the "10x" players they want - guys like A-Rod and Clemens and Ichiro. The Red Sox have a pretty big budget, but not as high. When they were very successful in the '00s, they had maybe half what the Yankees had. They also routinely lost good players to teams who could pay more. How did they win? They had amazing farm teams. They bought up promising young players and taught them how to be major-leaguers - how to win. And you know what? It worked.

Companies awash in cash can afford to go out and head-hunt the big guns. The rest of us have to develop talent. In that atmosphere, a teacher is far more valuable than a big gun. And a team player who knows how to communicate and make a whole team more productive (even if they're not teaching) is still more valuable than a big gun who only works alone.

The Stamina Bar Model of Emotional Energy

A lot of people talk about the Spoons Model of Disability (and more recently, the Forks Model), and I know a lot of folks (disabled and non) who apply the principles to describe their own lives. I have talked about being "low on spoons"; some might call this appropriative but I think it applies to a lot of us for whom the demands of life routinely exceed the available supply of energy.

Stamina bar
The stamina bar is the yellow half-circle on the right.

Recently, though, I've come to prefer a new model inspired by the stamina/mana bar from Dragon Age: Origins. In this game, anything interesting you do consumes stamina, so if you're planning on not getting eaten by Darkspawn you need to make sure your characters have a constant supply.

Emotional energy is a bit like that. We've each got a budget to spend on stuff like motivating ourselves to be productive, giving love and care to our friends and family, and making good choices for our own well-being. What happens when we run out is different for different people, but we've all been in a situation where we've had difficulty getting out of our pajamas or resisting that free donut at work or not snapping at an acquaintance over something minor. Science backs me up on this - studies have shown that we each possess a limited amount of willpower and are more likely to make short-sighted, comfort-seeking decisions when we're spent.

The thing is, people lead stressful lives. Everyone has their challenges. But most people have a pretty decent reservoir of stamina to draw from - plenty for the normal day-to-day, at least.

So what's the problem? Activated vs. sustained abilities

In Dragon Age, there are two kinds of abilities a character can use. Activated abilities are one-time and use up a chunk of stamina. If you have enough, you can use the ability, and maybe later you can use it again. In the Stamina Bar Model, activated abilities are things like "shave my legs today" or "choose something healthy for lunch" or "ignore my annoying co-worker" or "pay attention during this meeting". Again, most people have more than enough stamina to do most of these things most of the time, to the point where they don't think much about it.

But there's another kind of ability that's just as crucial for winning the game - sustained abilities. Sustained abilities aren't a one-time use of stamina. When they're turned on, they sequester a portion of your pool, effectively reducing your total. In the Stamina Bar Model, anything you're constantly dealing with is a sustained ability. Obviously, if you've got a physical or mental illness, you're got a really expensive sustained ability that you need to always have on just to function. But being able to go out into a busy space if you're introverted or have social anxiety is also a sustained ability. Dealing with the constant micro- (and macro-) agressions that come with being a minority, woman, visibly LGBTQ person, etc. is, too. So is having to worry about the rent, or how you're going to feed your children.

A sustained ability
A sustained ability (Dragon Age II)

A lot of us don't have the luxury of using our entire stamina bar, because we need to have a bunch of sustained abilities up just to be able to function. For example, the "IDGAF Field" I need to be able to go out in public presenting female when I don't pass is a huge chunk of my stamina bar, which is why I don't do it very often (and deeply admire the women who do and still manage to live their lives).

Living with chronically low stamina

Everyone develops coping mechanisms to deal with stamina drain. Some people overeat. Some smoke, some watch trash TV or procrastinate on their household chores or surf the web when they should be working. People with big pools find a way to strike a balance so they almost never get too low, because getting low can be bad - like, having a breakdown in public bad.

People with chronic illness, or for whom going out in public is unpleasant or dangerous, or who have constant life struggles don't have that luxury. They're constantly running near empty; constantly having to make compromises.

You don't always know how much stamina you have left, but you can usually tell when you're about to run out. I tend to find myself becoming unfocused and irritable, or craving junk food. But most people who have to deal with chronically low stamina have coping mechanisms - they comfort-eat, they retreat from social situations, they allow themselves to drop a few sustained abilities and buy that little bit of extra juice to get themselves through the rest of the day. But this makes them less productive and less fun to be around (if they're around at all) so there's a social and economic cost to it.

Because gods forbid you that don't notice you're getting low; that you actually get to zero. That's panic attack, emotional outburst, crying in public, making-a-total-scene territory right there. And yeah sometimes you get to that place (or close to it) without realizing it and all of a sudden you're all in Emergency Shutdown Mode trying to keep from just completely losing it.

big-red-button-brb

Accommodating people with chronically low stamina

The biggest takeaways from this whole thing, I think, are that (a) some people just have a smaller reservoir of energy available, (b) it's often due to external factors beyond their control, and (c) some of them have built up coping mechanisms to deal with it. It doesn't mean they're weak-willed (often they'll have built up very big stamina bars or fast regeneration just to be able to function!) or bad people, just that they've got other shit draining them and have to let something go. Maybe they smoke or overeat as a coping mechanism. Maybe they're angry because they're constantly dealing with microagressions and don't have the energy to let yours just roll off. Maybe they don't want to hang out or aren't very good company because they're emotionally exhausted and literally can't muster it.

The best things you can do for people in this situation are:

  • Don't judge
  • Offer support even if they don't ask for it; sometimes asking can be difficult
  • ... but leave them alone if that's what they need
  • Understand if they're hurting - don't take things personally; be as charitable as you can
  • If they're using up too much of your own stamina bar, it's okay to back off; remember that you don't owe anyone your time or energy

Running on air

Wile E. Coyote, realizing he's walked off a cliff and waiting for gravity to kick inIf you've ever watched the old Warner Brothers cartoons, you'll recognize this image: every other episode or so, Road Runner would trick Wile E. Coyote into running off a cliff. And because of cartoon physics, gravity wouldn't kick in until a split second after he noticed he was no longer running on solid ground.

It's kind of an awful moment, and one we've all had in our own lives (metaphorically, of course - I don't expect anyone reading this will have fallen off a cliff). Every one of us has had a time when we've suddenly realized that we've done something with serious repercussions and that it's only a matter of time - seconds, hours, days, maybe years - until gravity kicks in and we finally fall to our doom.

That's how the past six months have felt for me. I knew I was running off a cliff but I did it anyway. Now I'm frantically pumping my legs, hoping to get to the other side before Mother Nature decides she's got it in for me after all and I plummet to the bottom of the canyon. I've been extraordinarily lucky so far, with an understanding workplace, accepting friends, and a supportive family. The air is still feeling mighty solid under my feet.

And yet there are a million ways it could go wrong. I could lose my job. I could get sick or get in an accident. My car could break down. Pretty much anything that keeps me from getting to the surgery I'm planning for the end of the year - surgery that will mark the end of the most dangerous segment of my transition - could derail my life and send me into a spiral of poverty and discrimination that I might never emerge from. For that matter, the surgery itself could be botched, though I shudder to even consider what that would mean.

All it would take would be for one thing to go wrong and gravity would kick in, full force.

I'm one of the lucky ones.

Continue reading Running on air