Real Life Sorting

Sorting is a basic part of any computer science program. My sister and I are currently engaged in helping my parents move. As part of that effort I am spending sorting things, which has reminded me of another place where it can be useful to apply things you learn in one field to another.

Bucket and Radix sorts are basic sorting approaches taught in any good algorithms class. The process involves sorting like items into buckets, and then resorting items, either within those buckets (bucket sort), or by their next property (radix sort).

Piles of coin mid-sort
Coins mid-sort, with like piles gathered, and quarters being sorted for uniqueness and rolling.

In practice, as a developer I nearly never implement my own sorting algorithms; a language library is almost certainly going to be better optimized than what I would write, and it already exists. What’s more these two sorting processes are rarely the best in practice for most datasets. But in real life, we need to sort stuff all the time, and where these don’t make sense in many computing settings they are often the best way to sort physical stuff.

I spent my evening applying this theory to sorting the coins my father has collected over time (he’s actually a few feet away sorting more coins right now). I took the embedded picture mid-process this evening between having gathered coins by type, and was pulling out Quarters for collecting vs rolling — other denominations will come later. My sister and I have been helping prepare for the move with a similar process on a larger scale of gathering like-items together to help review and pack them as we progress. There is even science behind the concept that this is the most efficient way to sort things.

Unlike that article, my point is not just to help you sort things faster, but to support for my general argument that having well rounded education is the best form of education for life-long engagement. When I first read the article saying that radix sort was the fastest way to sort socks it made total sense to me – I already sorted socks that way because I’d realized it helped break the problem down. I took the idea from the same place the author did, my computer science training.

Generally I make this argument in the reverse; non-CS courses made me better as a developer. But it’s just as true that my CS courses taught me things that make my day-to-day life better.

No one field has all the answers to our problems as individuals or as a society.

My Ongoing Liberal Arts Education

I consider listening to good podcasts to be part of my ongoing liberal arts education. We all can benefit from being conversant on many topics, understanding their interplay, conflicts, and mutual inspiration. That broad understand allows us to be more informed voters and more flexible contributors at work. It also just makes me happier.

I make a point of mostly listening to things outside my field of work. I study my work 40+ hours a week already. In my spare time I like to learn other things. Right now my rotation includes shows like Hidden Brain, People I Mostly Admire, Freakonomics, Wait Wait Don’t Tell Me, and more.

I tend to listen to things in fits and starts and then suddenly in waves. If I walk the dogs alone I’ll listen to parts of an episode. While mowing the lawn I’ll squeeze in a couple things. But it’s really the long drives that let me pack in a lot of information. For example, at the end of June I had to do a 12 hour drive on my own, twice. So I got caught up on some episodes that had been building up on my phone.

One of the things I like about listening to these shows is different perspectives on different topics. They provide me a chance to hear overlapping ideas that inspire new ideas related to my work or life. Sometimes those overlaps build on each other, other times conflicts in ideas push me to think deeper about both sides.

This I listened to a People I (Mostly) Admire interview with Philosopher Will MacAskill. They talked about extreme long-term view of morality, effective altruism, and the limits of growth economics.

Currently, economic growth is like 2 percent, 3 percent per year. What happens if that continues for just 10,000 more years? Well, 2 percent compounded over such a long time gets to a very large number indeed where it would mean that for every atom within 10,000 light years — so, every accessible atom within that time would have to produce the economic output of some enormously large number. I think it’s something like 10 to the power of 60. But just think trillions times trillions times trillions of amounts of output as the entire world economy today. And now, I’m not claiming I’m certain that’s impossible. The world today is magical and fantastic and would be judged as such from the perspective of people 1,000 years ago. But it seems really unlikely that every single atom is able to produce many trillion times the economic output of the world today.

Will MacAskill

It was a compelling enough argument to get a Chicago Economist to question his assumption that economic growth is a given.

But it’s funny because, as an economist, I’ve been so indoctrinated into this idea that economic growth is natural, it’s good, it’s part of life, that just something should have been totally obvious to me, but wasn’t because of my indoctrination, all it took was a few lucid arguments from you.

Steve Levitt

During the drives in June, I wandered through several hours of Hidden Brian. The episode that stuck with me was, Do Less featuring Leidy Klotz talking about the power of subtraction from designs. But it’s not just the singular interviews that I find useful. Listening to large amounts of divergent information causes ideas to cross pollinate. The Klotz interview connected in my head with an episode of People I (Mostly) Admire featuring Dan Gilbert, Turning Work into Play, which included the advice to do less, better.

Well, I’m loath to give advice because I’m telling you what worked for me. And that doesn’t necessarily mean it works for anybody else. But I do suspect that many, many people would be much happier if they did less, better.

Dan Gilbert

That whole line of thinking has me trying to re-frame how I talk about building tools as part of my job. How can I make my work better by removing tasks? I even started to write a response piece in my head, which may come together some day.

As a Salesforce Developer (and a Web Developer before that, and a Nonprofit Communications staff person before that), I get encouraged to listen to a very small set of information. People assume I listen to Salesforce Podcasts and not much more. Many of us are encouraged to spend our personal time learning about our work – usually narrowly about the sub-field we’re in.

My point isn’t that they are always right, nor that I’ve picked shows presented by people I always agree with. The guests and hosts in the podcasts often express interesting ideas, but also have view points I disagree with or ideas that conflict. For example, I find that Steve Levitt (who I mostly admire) has an overly simplistic view on gun violence. Shankar Vedantam often has guests on Hidden Brain whose ideas conflict with other guests. My point is that listening to these ideas, letting them challenge my thinking, and building on them my life better.

Life is big and complicated, and involves a lot of not-work. Go find some things worth learning about that aren’t part of your regular activities. See where it takes you.