designerzord

By Sam Rosenthal

Filtering by Tag: January 14

The Lifetime Variable

if (time > lifetime)

We have a funny way of discussing our own mortality. The shared truth that eventually, all of us will die is hard to talk about and usually left unspoken, but it rears its head in nearly everything we make.

Sometimes, its presence is explicit. Video games like Journey and Passage are deliberate meditations on the subject, each directly addressing the transition from life to death.

Usually though, its presence in our work is a bit more subtle. We call an expired battery "dead." We use the same term to describe a broken engine, computer, lightbulb, etc. 

Perhaps its most obvious presence is in our code, the very fabric of digital creation. When I create a new class in code, it usually has a lifetime variable to keep track of how long it has existed, and to help remove it when its time has come. The human class, the one each of us inherits at birth, also contains this variable, but it's private and can be cut short at any time. 

For most of my life I was fortunate enough to not experience loss, but over the past few years I lost a number of people I loved too soon. Such is the nature of life - it is one of the most unbalanced and unfair games in existence. Every human starts out with the same variables (lifetime, familyWealth, numSiblings, etc) but all at different values, and each of those values can be changed at the drop of a hat. Death in both video games and life is often frustrating and sometimes avoidable, but no matter when it inevitably comes, few would say they weren't glad for the opportunity to play. 

As we bring in the New Year, remember that each person you meet comes from the same code, just with different numbers. When you are ensnared in a petty conflict, do not forget that all of our lifetime variables will eventually expire, and that the game of life is at its best when enjoyed together. Cooperative games after all, are still the most fun. 

Here's to another year of playing.

currentYear++;