What Does Choosing and Applying Eyeshadow Teach us About Coding?
Where makeup meets code!
I love eyeshadow. I have over 40 eyeshadow palettes (a palette is a container with any number of individual eyeshadow colors), and I don't think my obsession diminishes my status as a progressive woman in technology. I am known for my sparkly blue colors which represent my never-ending devotion to Ravenclaw house in Harry Potter. The sad truth, however, is that I suck at choosing and applying eyeshadow, which might have something to do with the fact that
- I have too many colors to choose from, and
- I need to take my glasses off to do it.
Yet this doesn't stop my insatiable need for acquiring more shadow options. After I left my trusted makeup store last week having spent over $100 in products, including a new eyeshadow palette (none of which I needed), I thought
"if only choosing and applying eyeshadow was as easy as writing a function."
That is the origin story of this blog post. Using code to solve practical problems is a hallmark of the field of technology, but it takes practice. Here is my attempt at a "think-aloud"* to solve my eyeshadow problem.
*For those of us with a background in education, a think-aloud is a method of making an invisible thought process, visible. We use this technique frequently in reading instruction.
Function Basics and My Eyeshadow Routine
Understanding functions is a rite of passage in programming. When you first begin your journey, you write out each and every line of code, numerous times. Enter functions. A function is nothing more than a procedure, a set of steps for completing a task. Generally, a function will take some input data, perform the required procedure with that data, and return any resulting data. What makes functions so versatile in code is that you can call that function, or set of steps, over and over again with different inputs, hence different outputs.
Putting on eyeshadow is like following a set of steps. I stick to the same set of steps (function) for choosing and applying eyeshadow practically everyday illustrated in the below diagram.This image was part of a blog post on BellaBox HERE
Let's think about this in terms of programming where we have an input, a set of steps, and an output.
- Input: I need to input an eyeshadow palette. Let's say the "Sweet Peach"palette by Too Faced Cosmetics.
- Function: My function needs to filter through all of the colors (18 total) and find the four key colors to use: highlighter, medium, smokey, and blender.
- Output: Tell me specifically which colors match which eye application area.
Input Eyeshadow Data
Have you guessed the first problem here? The input data isn't as simple as a variable with a string or number value:
The Sweet Peach palette has 18 colors. You might be thinking, we can write each color out in an array (or list):Yes, that's only 6 out of the 18, and yes, eyeshadow color names are quirky.
There is still a problem with the shape of this data. An array is just a list of the colors. Each color needs a label to identify which type of color it is: highlighter, medium, smokey, and blender. A better option might be an array of objects. An object is a collection of data organized by a key and a value. In each object here, we have two key value pairs, one for the type and the other for the color:
Perfect. Every time I use "SweetPeachCombination" as my input, I will know exactly which color to use for which part of my eye.
FindColor Function: The Parameter and the Argument
Now that we have some data, we can look at what the function might do. I want to be able to call this FindColor function with any input data and know exactly what color goes where. First, I need to loop through the array. Then, I need to log the type and color. The code could look like this:I am using ES6 template literals in the console.log.
Since this is not actual code, I'm just going to log the information to the console. On my actual website, I update the information through the DOM. See website HERE.
Let's dissect the above code.
The function is called findColor, and it has one parameter.
Parameter, here, is a technical way of saying input placeholder — meaning, we need the combination information in order to run the function. Remember, though, we can use any combination we want, so the parameter is not specific.
How do I tell the function which combination to use? When we call the function:
we pass in the specific combination. This changes the technical word. It is not a parameter anymore, it is now an argument. The difference being that this is the real data, not a placeholder. You can see that clearly because the parameter is called "combination" while the argument is called "SweetPeachCombination."
Refactoring the Eyeshadow Inputs
Seems like a pretty lame function right now, right? I'm literally giving it the data of which color goes where and then having the function spit that information right back out (the output). But remember I have 40 palettes of eyeshadow. I honestly can't remember each individual color or possible combination. Right now, I have just one combination for just one palette…
I bet you see where I'm going with this.
My eyeshadow input data doesn't reflect reality — multiple palettes with multiple colors means endless possibilities. The shape of the data does not have to change, but I need to add more information:This is one of my blue combinations, so I've named it accordingly.Can't leave out Slytherin House and the green combination!
Naturally, we will need to revise the function based on this new information, but that's the easiest part:
Theoretically, I could have 400 combinations! I don't have that kind of time in the morning to look for the right combination. That's why my FindColor function works perfectly. Everytime I call that function, I use a combination argument.
The Most Important Part
I say this all the time about programming. If you can dream it, you can build it.
I dreamed of an eyeshadow color picker, and I built it (screen cap below).Check it out HERE. Get the code HERE.
So what are you going to build next?
Growing Your Career in Technical Support: 4 Tips for Getting Hired at Elastic from Support Director Heidi Sager
Heidi Sager loves math, but she also loves working with people.
She always has, which is why she enjoyed her part-time job working at the IT department of the University of Colorado while she was studying electrical engineering. (She'd started in computer science, but explains that it "wasn't for her" and switched her major.) She helped students and professors with word processors, basic programming, and software checkout, and took a full-time job after graduation as a UNIX system administrator.
Working at Relativity—the global tech company that equips legal and compliance professionals with a powerful data-organizing and discovery platform—looked different in 2020. The highly collaborative environment of their Chicago headquarters transitioned to a virtual setting, and just like companies around the country, Relativity adapted their goals and major projects to a completely remote environment.
Diversity Reboot 2021: The One Hundred Day Kickoff<p><strong>When</strong>: February 1-5, 2021</p><p><strong>Where</strong>: Virtual</p><p><strong>Price to register:</strong> Free!</p><p><strong>Where to register: </strong><a href="https://summit.powertofly.com/" target="_blank">Here</a></p><p>We had to include our own Diversity Reboot on our list of the best diversity and inclusion events to attend in 2021 because we know firsthand how the quality of 100+ expert speakers, the enthusiasm of 10,000 participants, and the cutting-edge tech that enables meaningful virtual networking and job fairs combine to create a truly epic five-day experience. This year, the theme 100 Day Kickoff harnesses the energy of the new government's first 100 days in office to help jump-start personal and professional plans to build more diverse and inclusive workplaces. </p><p>Following the February summit, we'll have a monthly series of smaller virtual summits on topics spanning everything from returnships to LGBTQ+ advocacy, so be sure to stay tuned for updates!<br></p>
The Future of Diversity, Equity and Inclusion 2021<p><strong>When</strong>: February 3-4, 2021</p><p><strong>Where</strong>: Virtual</p><p><strong>Price to register:</strong> Free</p><p><strong>Where to register:</strong> <a href="https://www.hr.com/en/webcasts_events/virtual_events/upcoming_virtual_events/the-future-of-diversity-equity-and-inclusion-2021_kcxf8glq.html#detail" target="_blank">Here</a></p><p>This virtual conference put on by HR.com focuses on how social movements like #MeToo and Black Lives Matter have pushed DEI at work beyond legal compliance and into a major factor of any company or brand's culture, employee engagement, and performance. Topics include how to uncover and resolve pay gaps across your team and hire top-level diverse talent.</p>
Workplace Revolution: From Talk to Collective Action<p><strong>When</strong>: March 8-12, 2021</p><p><strong>Where</strong>: Virtual</p><p><strong>Price to register: </strong>$820</p><p><strong>Where to register:</strong> <a href="https://cvent.me/ZQ4BbE" target="_blank">Here</a></p><p>The Forum on Workplace Inclusion's 33rd annual conference includes 12 session tracks, from DEI Strategy to Social Responsibility, along with 59 workshops and daily networking sessions. This year's theme focuses on one question: "What will it take to start a workplace revolution that moves us from talk to action?"</p>
Diversity: How Employers Can Match Words With Deeds<p><strong>When</strong><strong>: </strong>May 19, 2021</p><p><strong>Where:</strong> Virtual</p><p><strong>Price to register</strong><strong>: </strong>Early bird registration is $49 and general admission is $149</p><p><strong>Where to register:</strong> <a href="https://hopin.com/events/may-virtual-conference-diversity-how-employers-can-match-words-with-deeds" target="_blank" rel="noopener noreferrer">Here</a></p><p>From Day One is hosting monthly conferences in 2021 focused on different ways for companies to foster strong relationships with their customers, communities, and employees. May's half-day virtual event is focused specifically on how companies can make diversity promises that don't fall flat and features workshops, panels, and a fireside chat.</p>
Hire with Diversity, Equity, and Inclusion<p><strong>When:</strong> August 18, 2021</p><p><strong>Where: </strong>Virtual</p><p><strong>Price to register: </strong>$195</p><p><strong>Where to register:</strong> <a href="https://www.hci.org/conferences/2021-virtual-conference-hire-diversity-equity-and-inclusion-august-18-2021" target="_blank">Here</a></p><p>This conference put on by the Human Capital Institute is one of 12 virtual conferences that HCI has planned for 2021. This one focuses on fair and inclusive talent acquisition, including how to attract diverse talent, implement inclusive hiring practices, and addressing bias in employee selection. Other conferences will focus on optimizing talent strategy, engaging employees, and developing your workforce.</p>
Virtual Grace Hopper Celebration 2021<p><strong>When:</strong> September 26-29, 2021</p><p><strong>Where:</strong> Virtual, broadcast from Chicago, Illinois</p><p><strong>Price to register:</strong> Was $799 for regular access to the virtual conference in 2020; 2021 pricing hasn't yet been announced</p><p><strong>Where to register:</strong> <a href="https://ghc.anitab.org/attend/registration/" target="_blank">Here</a>, though 2021 registration wasn't live at the time of writing</p><p>Grace Hopper might be the best-known conference for women in tech. Through keynote presentations, networking sessions, job fairs, and community-building activities, vGHC reached over 30,000 women for their 2020 conference and are expecting even more in 2021! While not a conference focused exclusively on diversity and inclusion, many speakers plan to focus their talks on creating environments for women to thrive in the male-dominated tech field.</p>
Inclusion 2021<p><strong>When:</strong> October 25-27, 2021</p><p><strong>Where:</strong> Virtual and in person in Austin, Texas as of now</p><p><strong>Price to register:</strong> Hasn't yet been announced</p><p><strong>Where to register: </strong><a href="https://conferences.shrm.org/inclusion" target="_blank">Here</a>, though 2021 registration wasn't live at the time of writing</p><p>The Society for Human Resource Management's biggest conference of the year saw 1,200 DEI leaders participate last year; SHRM hopes to see even more come to learn, be inspired, and to walk away with a playbook of implementable strategies to create truly inclusive workplace cultures.</p>
AfroTech 2021<p><strong></strong><strong>When:</strong> November 8-13, 2021</p><p><strong>Where:</strong> Virtual</p><p><strong>Price to register:</strong> Early bird pricing is $149 for individuals and $249 for corporate attendees; regular pricing hasn't yet been announced</p><p><strong>Where to register:</strong> <a href="https://experience.afrotech.com/" target="_blank">Here</a></p><p>AfroTech is a conference hosted by Blavity, a tech media platform for Black millennials. It focuses on emerging tech trends, connecting Black talent with top tech recruiters, and providing networking and educational opportunities, with an overall goal of building a strong Black tech community. Over 10,000 people participated in 2020. While the conference isn't focused specifically on DEI, its main audience of Black tech talent is an important one to understand and to engage at work and beyond, and several speakers plan to focus on issues of race and inclusion at work. </p>
A Conversation with Vouch's Lead Designer Carrie Phillips