As a programmer, I don't consider endless streaming music to be a luxury. Good tune-age is, quite literally, a core requirement of my workspace. To satisfy that need, I'm a Spotify Premium member.
For the most part, it's an epic service. If I divided my monthly bill by the hours of music I receive, it would easily be one of best values I've ever purchased. But that doesn't mean that Spotify is without faults. And at certain points in the past, those faults have driven me absolutely INSANE.
[NOTE: This is the second half of my treatise on randomness - and how it can ruin your users' experience. In the first article, I outlined some of the cognitive biases that can undermine "random" features in applications. You can read it here: https://dev.to/bytebodger/random-can-break-your-app-58bo]
I have playlists. Most hardcore Spotify users do. My blues playlist has 436 tracks. My drum-n-bass playlist has 613 tracks. Most of my heavily-curated playlists have somewhere between 400 and 700 tracks.
I often switch between my playlists depending upon what's going on in my day and where I need my "headspace" to be. When I'm in frenetic code-euphoria mode, I'm cranking out my drum-n-bass list. When I'm in a more contemplative place, I might be listening to traditional jazz. So over the course of a single day, I might spend an hour-or-two listening to as many as 10 different playlists.
Here's the problem:
When I switch to a new playlist, I want to come into that playlist as though I've just switched the radio dial to a targeted genre station. That station doesn't know "where I left off". That station doesn't know what I might have heard yesterday. The station just keeps cranking along, oblivious to whether I'm listening or not.
The station has an expansive list of tracks they'll play. And they play those tracks, more-or-less randomly, over the course of several days. And I want my Spotify experience to mirror this.
But Spotify stubbornly, angrily, obstinately, pig-headedly refuses to let me have this experience. This refusal comes in the form of their utter disregard for their so-called "shuffle" function.
If you've ever used Spotify yourself, you might be thinking:
But Spotify has a shuffle feature. It's a button that looks like two crossing arrows.
And of course, you'd be right. Spotify does indeed have such a feature. But the feature has nothing to do with a "shuffle". It's a lie. Spotify does "shuffle" the same way that Republicans do "civil rights". It's a button that does... something. But whatever it's doing, it has no relation to the label.
You see, in a perfect world, "shuffling" implies a true randomization of the data set. As I covered in the previous article, "random" doesn't mean that it will satisfy what every layperson views as "random". "Random" means truly damn random.
In other words, when you truly randomize a data set, it will have no bearing on any previous results. "Random" can, in fact, contain "trends" (although they are trends that will evaporate once you try to track them).
But when you use Spotify's "shuffle" feature, you'll find that those trends pop up all-too-often. You'll find that certain songs, somehow, keep creeping up to the top of your playlist. And other songs never seem to get played.
If you understand probabilities the way I do (and as a high-stakes poker player, I have some serious experience with this), at first you'll brush these repetitions off as the kind of fleeting coincidences that can occur in a truly random data set. But after you spend hundreds of hours listening to your playlists, you'll eventually come to understand that these strange coincidences have nothing to do with the vagaries of randomness.
I thought my "quest" was simple. I didn't think I was chasing the Holy Grail. All I wanted was to get a fresh SHUFFLE of my playlists any time I desired.
What do I mean by "shuffle"??
Well, think of it just like a deck of cards. Between every poker hand, the cards are thoroughly shuffled. (In any modern context, this is done by an automatic shuffling machine.)
This means that every hand is a completely new, completely independent event. Yes, it's possible that you'll hear the same song that you heard in your last session. And it's possible that you'll "miss" other songs over multiple sessions. But I'm perfectly fine with that. I just want my playlists to be played in a truly random manner.
I want to know that, every time I "shuffle" a playlist, the Humpty Dance could come up as the first song in the mix. Or... I may not hear it again for awhile. That's the true nature of randomness.
But Spotify doesn't work this way. How do I know that??? Well, I'm glad you asked...
I'm not the only one annoyed with Spotify's not-so-randomness. Many others have noticed that some of their songs get played repeatedly. While other songs simply never get played.
If you wanna get a sense for the scope of the problem, just google "spotify shuffle sucks" and behold the massive menu of rage posts. Their own "community" forum site has many threads complaining about the issue. One of those threads has 189 pages of ongoing comments, spanning back over years.
Is this a case of a tone-deaf company completely ignoring an issue? Not exactly. This is a case of an arrogant company swearing that they've fixed the issue. They published this cheeky explanation of their approach way back in 2014 where they graciously congratulate themselves for their high-minded brilliance:
They acknowledge that the "shuffle" algorithm isn't at all random. They brag about how they've supposedly fixed it by implementing a better algorithm that accounts for peoples' misconceptions about randomness. And for the last 6+ years, they've stubbornly refused to do anything else about it - even though there are thousands of ongoing complaints across the internet about their super-janky faux shuffler.
But their shuffle algorithm doesn't even work the way that they say it does. If you spend excruciating amounts of time diving into the behavior of their application, it quickly becomes quite clear that some songs just get repeatedly ignored.
This isn't a case of me seeing nonexistent patterns in the noise. I can pretty much prove that their "improved", better-than-random algorithm just can't be bothered to play certain songs. In fact, I put up a repeatable use-case in their own forums. You can read it here:
You'll also notice that I titled the post in their community forums as
Please stop marking shuffle complaints as "not an issue" or "implemented". I gave it that title, because that's exactly what they do.
User after user after frustrated user complains about the exact same thing. And their response is simply to mark the complaint as "not an issue" or "implemented". For the post above, in which I gave them a detailed write-up of how to recreate the issue, they answered:
We understand your situation! We're looking into it and we're working on our shuffle algorithm. Keep an eye on any updates soon. Take care.
Then... they marked the ticket as "Not An Issue".
This probably feels like it's just a long angry rant about a particular company that can't be bothered to fix its own software. But I'm writing this up on Dev.to because there are valuable lessons for us to take from this example as programmers.
Spotify went down this path because people inherently misunderstand randomness. I get that. But they decided to fix a "problem" - by introducing another problem.
Most people just don't grok random sequences. They have 100 songs in their playlist. Five of those songs are by Justin Bieber. After the playlist is randomly shuffled, they hear two Justin Bieber songs in a row. And they start thinking: "Heyyy! That's not random!" But... it is.
If you shuffle your 100-song playlist that has 5 Bieber tracks, it's perfectly possible that you might end up hearing 2 of those tracks in a row. The same concept is at play when you thoroughly shuffle a deck of playing cards and two aces are dealt out in a row. It's absolutely possible. And it doesn't mean that the shuffle wasn't "random".
To be clear, Spotify was justified in trying to rig their "shuffle" feature. Because if your users repeatedly perceive that there's a problem in your app, then there is a problem in your app. It won't do any good to yell at them that they just don't understand randomness.
The mismatch between perception and reality is often most acute whenever we try to implement random features in our apps. It could be a music playlist. It could be a "quote of the day". It could be a game where the damage incurred by your character is calculated as a random die roll. In all these examples, it's tempting to just slap a random number generator on it and call it a day.
But if too many of your users perceive that the process isn't random, they may become frustrated to the point that they're no longer your users. In fact, if they're really frustrated, they may even complain to your potential future users. In the most extreme cases, you may reach a situation where you simply have no users - even though your random algorithm was mathematically flawless.
So if randomness carries the risk of being misinterpreted by your users, how can you solve the problem? Well, you could choose to follow the patented Spotify Method:
Make an obtuse change to your algorithm and brag about it in a blog post.
Offer no options to the user in the UI.
Any time someone complains about the new algorithm, mark their complaint as "Implemented" or "Not An Issue" - without making any changes.
If this approach doesn't appeal to you, then, congratulations! You're not a douchebag. So what other options do you have?? Well... here are some thoughts:
Don't make monolithic decisions for your users.
Whenever possible, give your users options. I don't mind that Spotify felt it necessary to implement some kind of "enhanced" shuffle algorithm. That's fine. But give me the option to turn it off. Or maybe, somewhere in the "Settings", allow me to actually choose which algorithm I prefer when shuffling.
Don't treat your API as a fix for UX problems.
I bring this up because Spotify does have an API that will allow tech-types like us to build our own shuffle features. I eventually solved this by writing my own custom shuffler that leverages their API. There are a handful of other "Spotify shufflers" out there on the web.
But this should never be the "answer" to problems inside your app. It's wonderful if you can manage to supply a robust API that allows users to extend your app's functionality. But the vast majority of your users will only ever use your app... inside your app. They either don't know how to build API integrations - or they can't be bothered to.
Be transparent with your algorithms.
We tend to protect our algorithms more than we protect our children. But when you have a feature that frustrates your users, that frustration can be multiplied by their ignorance of how the app is actually working. I'm not saying that you need to hand over your complete code base. But for something as "magical" as shuffling, it would go a long way toward mollifying your users if you just explain to them - clearly, accurately, and concisely - exactly how the sausage gets made.
The Spotify experience is especially aggravating because, after extensive research and testing, I was able to repeatedly demonstrate that their algorithm does not work in the way they claim it works. And yet, they refuse to do anything about it. In fact, they refuse to even acknowledge the issue in any way.
Give users a history of past results.
This can go a long way toward alleviating user frustration. It's only natural that, when I'm using your battle simulator, it feels to me like I lose at a disproportionate rate. But if I can view a history of my last 500 battles, it's at least possible that I may look back over that history and realize that the world (your app) isn't truly tilted against me.
Carefully consider if randomness is what you truly want in your app.
Once you understand that users inherently misunderstand randomness, it's reasonable to ask yourself whether you really want to use randomness at all.
For example, imagine that my app is an online media player that continually streams a selection of video highlights from local high school athletics. Let's also imagine that I have a library of 10,000 such clips to choose from.
It would be incredibly simple to just load up the IDs for all 10,000 and then randomly select one after another after another. But I can almost guarantee that this will lead to complaints from my users.
You see, it's inevitable that, in my random video queue, I'll eventually play two, or three, or four highlights all in a row from the same high school. It's also inevitable that some of my viewers will start griping about the idea that my app is "biased" toward one school, or against their favorite school.
It probably makes more sense to spend some time categorizing the video clips by school, by sport, by player, etc. Once they're categorized, I can write a more tailored "randomization" algorithm that will take these factors into account before building the video queue. Yes, that requires more work, and more forethought. But if it fosters the long-term success of my application, it's well worth it.
In the end, there are some times when "true" randomness is absolutely necessary. But be warned, it's almost impossible to implement a feature based on randomness that won't lead at least some of your users to complain about the non-randomness (that they perceive). How you choose to address those perceptions will go a long way toward determining the success, and the public acceptance, of your application.