CRUDifying Music: From Mixtapes to Playlists
Depending on your own contextual understanding of programming you may be asking one of two questions:
- What the hell is CRUD and why did you greet me as such? OR
- What does CRUD have to do with mixtapes and playlists?
Allow me to build out the context. When I was in high school, applications such as Napster, iTunes, (must I mention Limewire?) started to change the music game by giving music listeners the ability to download an assortment of songs rather than them having to buy a separate CD to enjoy the songs they love. This opened up a world of possibilities for music listeners and budding internet hype-beasts. You were now able to store those songs in a library, you could sort the information based on song attributes such as artist, song title, genre, song length, etc., you could cherry-pick songs and add them into a playlist, and finally— you could burn or digitally transfer these songs onto a physical CD to enjoy in your car, CD player/walkman, stereo player, you name it.
Now let’s explore this limitation — what if you had put the wrong track on that CD, wanted to switch the order around, or remove the song? Unless you had a CD-RW, in which case you could erase and re-write, but you’d be in for a very lengthy process of creating a new CD. Comes in CRUD (Create, Read, Update, Delete) to help the digitization of our musical curation experiences. CRUD is a set of basic computer programming operations that deal with the creation and storage of data. In layman’s terms, CRUD is what enables users of applications such as Facebook, Instagram, Twitter, Spotify, etc. to create (sign-up/log-in users to create profiles; for those profiles to create/post content), read (read information, such as viewing those profiles, viewing the content), update (edit information, edit content, thereby by changing the information you’ve created or posted), and delete (delete a profile, delete content, delete comments, etc.). To delve deeper, we’ll unpack one of the most obvious examples of CRUD: a Spotify playlist.
Spotify took the mixtape game to ANOTHER LEVEL using CRUD functions. Let’s go on a journey of CRUD using the Spotify playlist:
Create is what you do to simply create in whatever application you’re using. Think about other instances in which you may be creating something such as, when you create a profile on Instagram, or a new post or story. Spotify playlist creation allows us to curate the best damn music (to personal taste) into one place. As a user, we initiate that process by clicking on an option that allows us to create that thing. For our Spotify playlist, we’ll click “New Playlist.”
What does clicking on this button give us? The opportunity to create and initialize our playlist starting with some personalized attributes such as the name and the description using a rendered form. As you can see we’ve named our playlist “Dat Funky Playlist”, we wrote a nice little description, both of which are data that can be stored into Spotify’s server- and now we can submit or create this playlist. On Spotify’s server-side, once we click create, it will create what we call an instance for this whole playlist which will hold information such as the playlist’s name, the description, and most importantly, the person who created that funky playlist, YOU! Below, I’ve included a piece of Ruby code that could be representative of back-end:
Playlist.new(playlist_name: "Dat Funky Playlist", description: "These are some of the funkiest tunes ya mama's ever heard!")
What this line of code says is that some user is creating a new playlist named “Dat Funky Playlist” and it has a description. This triggers the create action in CRUD. Now that we’ve fulfilled “CREATE”, let’s move on to Read to see exactly what we just did.
Read is exactly what it sounds like: it’s the things that you can view or read on your computer screen or mobile device. When we created our funky playlist, we were redirected to a page that allowed me to view what we just created. At this point, believe it or not, we are a step closer to unlocking full CRUD potential. As we can see, the newly created instance of our playlist reads the information that we just created. We see the playlist name, the description, we even see its creator (mari_world_, but we really just did that). I’ve taken the liberty of opening the drop-down menu so we can see the possibilities of CRUD which we will dig deeper into. An important thing to mention is that from the perspective of another user, they’d only be able to read or view your playlist as many applications incorporate permissions for security measures. Say if you share the link of your playlist, you don’t want another user manipulating the order of your funky jams (unless you make it collaborative), therefore they shall only read or view it, which brings us to the final steps in CRUD: Update and Delete.
Piggy-backing off the “Read” portion of CRUD, as the user that created this playlist, you also have permission to update or edit it. When we click “Edit Details” above, we’re prompted with an “Edit Playlist Details” form that allows us to change/update the details of our playlist. What if we wanted to change the name of “Dat Funky Playlist” or the description of it? That’s possible by typing in the changes you want and clicking “SAVE”, which will then update the information not only for your reading pleasure but also in Spotify’s server so that it can persist the changes where the instance of that playlist is stored. The update goes beyond changing the playlist details though. If you remembered when we first created our playlist, we forgot to update the most important part: THE FUNKY MUSIC. If you look at the screenshot above with multiple green boxes highlighting sections on our “Read” page, you notice at the bottom we have the option of adding songs to our playlist, therefore updating the playlist.
Below, we’ve added “Jungle Boogie” by Kool and the Gang. This update will persist with us unless we perform the last function of CRUD: Delete.
Let’s move along to the final part of CRUD: Delete. There’s not much to be said about delete except the fact that the scope of what you’re dealing with may vary depending on what it is you’re trying to delete. In the screenshot below, we see the option to “Delete”, which allows you to totally delete your playlist from your own library and Spotify’s server. I honestly see no reason to delete the funkiest one-song playlist in the land, but it’s nice to know that you can wipe out a playlist should you no longer see fit for it. With this, we have reached the end of CRUD, and we can now make infinite playlists or infinite changes to our current playlist. The important thing to know is that the backend of whatever application you’re using is finding safe ways to store things that you’ve created so that it can be read, shared, updated, and deleted at your will.
From my high school days of burning hot mix CDs for my classmates to today’s rise of platforms like Apple Music, Tidal, and Spotify, the rapid technological development has unlocked a world of possibilities for people to create, curate, change and ultimately build pieces that contribute to the culture of music, and to the culture of arts more broadly. Before coming to Flatiron School, I wouldn’t have appreciated the basic computer programming functions — such as CRUD — compose these beautiful, seemingly intricate applications. While I do have a deeper appreciation for these apps as a growing developer, a huge part of the reason I went into coding was to eventually expose others to this world, especially those who love and create music so that we can continue to make our marks in culture. Striving for perfection as a musician, I’m not foreign to the concepts of creation, updating/editing, deleting with a larger goal in mind. While I still have a long journey ahead of me, I’m happy to have learned so much in such a short amount of time as I continue my bootcamp experience, learn more, build more, and give more. Stay tuned!
If you have any interest in being an artist and/or software engineer or composing a fulfilling life — feel free to reach out, drop a comment, or better just go do it. Expect to hear/see more from me! You can connect with me on IG @mari.world, Twitter @mari_world_, GitHub and LinkedIn. Bless