This story is over 5 years old.


‘Bey Script’ Uses a Clever Beyoncé Analogy to Teach Non-Techies How to Code

Simple as "beyonce.sing(single ladies)."
Beyoncé at the MTV VMAs on Sunday night. Image: Getty/John Shearer

Learning to code may seem daunting for those less technologically inclined, but what if Beyoncé could help you out? Okay, she won't actually teach you how to code, but "Bey Script" could make JavaScript a little easier to understand.

As part of New York City's $80 million initiative to ensure all public school students learn computer science, teachers need to learn it first—and that's where "Bey Script" comes in. To help English teachers, history teachers, and other non-technical teachers learn coding, computer science educator Emily Thomforde developed the Beyoncé metaphor to make it easier for them to grasp JavaScript.


"If you imagine Beyoncé were an object we're using in JavaScript, her 'methods' are things that she can do, like sing and dance," explained Thomforde. In Java style, those methods are written as "beyonce.sing" or "" The dot is used to access the object. And to add an "argument" to a method, or more information about what that method should do, you might add parentheses. For example: "beyonce.sing(single ladies)".

Read more: Minecraft's Coding Tutorial Is Made for Kids, But I'm 27 and I Loved It

"'Properties' are things that you own or things about you," Thomforde continued. "When I ask, 'What's something about Beyoncé that can change?' everyone always says her hair. Now we have '', since hair is a property of Beyoncé. What's a thing about her hair that can change? Now we have ''. Then we can set it equal to something: ''"

The class happens in three sessions throughout the year, before teachers take their newfound knowledge back to their own classrooms.

Thomforde (right) in the classroom. Image courtesy Emily Thomforde

"I relate all these arcane, technical, traditionally geeky things into ways my audience can relate to, and we found Beyonce was super relatable," Thomforde said. She consults and writes the curriculum for Vidcode, an online platform that teaches teens to code. In collaboration with the New York City Department of Education, Vidcode teaches elementary through high school teachers not just how to code themselves, but also how to teach their own students.


Beyoncé is not only someone everyone knows and looks up to, but the metaphor also has a "girl power message running through it," said Thomforde. "If we can attach coding to things everyone loves, we can normalize it, make it accessible to everyone, and de-stigmatize it." Teaching teachers (and all their students) to code can help close the gender gap in computer science, she added.

Over the past 30 years, women have fallen out of tech. They've declined from 37 percent of computer science graduates in the early 80s to 18 percent today. (The term "software engineering" itself was coined by female engineer and computer scientist Margaret Hamilton.) According to the Planet Money episode "When Women Stopped Coding," by 1984 it became nearly impossible to succeed in computer science courses unless you already had a home computer. At that point, the stereotype of computers as toys for boys—especially, geeky hacker boys—became ingrained in advertising and public attitudes about tech. Excluded from that stereotype, girls pursued other professional fields instead.

"Bey Script," however, is an example for teachers of how they can take something relatable and use it to teach their students coding, or to integrate coding into a larger lesson plan that's accessible to all genders. For instance, in a history or English class, students can choose a vocab word or concept and make a video around it, said Leandra Tejedor, cofounder and design lead at Vidcode. "They can record videos and then code effects on top of them," she said.

"Coding is like giving kids a hammer," said Thomforde. It's a tool they can apply to all different areas, even outside computer science. "We're trying to get those kids at a young age before they have the chance to disenfranchise themselves based on stereotypes."

Moreover, a more diverse body of programmers will lead to better software that fits a larger market. "Coding is for everyone," said Thomforde. "We're trying to open it up to all people."