overhead view of a young boy wearing headphones and coding on a laptop
Caleb Willis participating in the Code Beats camp over the summer. The course teaches computer science skills through coding hip-hop beats. (Cassandra Willis)

Hip-hop paves the way to coding comprehension

Code Beats, a VCU professor’s course that teaches coding through music, is introducing Richmond middle school students to a new way of learning computer programming.

Share this story

On a Thursday afternoon, David Shepherd, Ph.D., an associate professor of computer science in the VCU College of Engineering, shifts away from his university duties to teach computer coding to 30 Richmond sixth-graders from the STEM Academies at Thomas H. Henderson and Martin Luther King Jr. middle schools by leading them in lessons taking apart and putting together hip-hop rhythms, beats and melodies. 

“Writing code changes what you hear,” Shepherd explained. “The cool thing about hip-hop is that each little track is pretty simple, but when you put it all together it sounds like an awesome beat.” 

In the virtual 10-week Code Beats class — taught remotely through a YouTube platform — Shepherd guides the students through computer science and coding. With hip-hop as the vehicle to convey the information, Shepherd and Taylor Barnett, D.M.A., coordinator of musicianship studies and instructor of jazz trumpet in the Virginia Commonwealth University School of the Arts, teach the students musical concepts like rests and rhythm, scales and chords, intertwined with computer concepts.

“Layering is a musical and a computer science concept; in computer science this is called modularization,” Shepherd said. He says the class is about finding “the right balance between pushing forward, full steam, with the content.”

“I want these kids, especially the ones that are really sharp, to have a chance to learn everything, but also making sure that when we deal with kids with less computer literacy, we don't want to leave them in the dust,” Shepherd said.

When he asks students: Why do you like hip-hop? One replies: “I like the beats.” Another says: “The lyrics.” One student wants to be a rapper. Another writes that they don’t like hip-hop. 

VCU's David Shepherd, wearing headphones and standing in front of a VCU Engineering wall.
VCU's David Shepherd is teaching coding to 30 Richmond sixth-graders from the STEM Academies at Thomas H. Henderson and Martin Luther King Jr. middle schools by leading them in lessons taking apart and putting together hip-hop rhythms, beats and melodies. (Kevin Morley, University Marketing)

Code Beats is just one of a number of courses in science, technology, engineering and math for students at the Richmond Public Schools STEM Academies.

“Our ultimate goal is to create the next generation of scientists, engineers, technologists and mathematicians through our program,” said Davell Smith, assistant principal at Martin Luther King Jr. Middle School. “Right now, African Americans, females and minorities are underrepresented in STEM professions. So the goal is to spark their interest as they become sixth-graders, and as they grow up they may want to be able to actually create something that they can use to help the community or pursue a career [in STEM].”

Code Beats is not just conceptual. Shepherd gives the students hands-on lessons where they create their own beats. The class sequence ends with a student hip-hop competition in which viewers vote for winners in elimination rounds. Shepherd views the short lessons as an upbeat and culturally relevant taste of coding, and as an appetizer to a future serious coding class.

Computer science education is mandated by the Virginia Department of Education, but not implemented across the board in numerous school systems. The U.S. Department of Labor Statistics lists computer programmers as well-paid, in-demand positions. Shepherd and Smith hope the technological understanding extends to families. 

There’s a lot of these kid computer clubs, but we target middle school because we see that as a key area where kids are underserved everywhere, not just in places like Richmond,” Shepherd said. “That ties into why we’re using music. We're trying to hit that key gap in middle school because middle school kids are the most likely to say, ‘Oh, [coding] is nerdy. I don't want to do it.’” 

Project development


Code Beats began last year as part of a capstone project Shepherd led for VCU engineering students with the goal of a one-day workshop for kids. Instead, because of COVID-19, Shepherd’s group developed Code Beats as a summer camp. Shepherd also taught the program to adults through the Northern Virginia-based Computer CORE job-training nonprofit. 

Now, four undergraduate students help Shepherd as moderators during the Thursday online class.

“We learned there are some challenges when using different software, and we learned to slow down instruction,” Shepherd said. “We learned certain concepts are harder than others for kids. We're learning the basics of teaching [this age group] better. Students look forward to, and enjoy, the [hip-hop composition] competition at the end of this class, which we had last time. It’s super motivating and fun.”

David Shepherd and Douglas Krug. Shepherd is holding a boombox to his ear and Krug is wearing headphones.
Shepherd, foreground, and Douglas Krug, a doctoral student in the Department of Computer Science, are collecting the opinions of the Code Beats students to understand if the approach helps change their feelings about computers and coding. (Kevin Morley, University Marketing)

Researching attitudes to computer science


Shepherd and Douglas Krug, a doctoral student in the Department of Computer Science, are collecting the opinions of the Code Beats students to understand if the approach helps change their feelings about computers and coding. The Code Beats summer camp participants already knew about computers and, Shepherd suspects, were already interested in coding. 

“So they had high scores at the beginning of interests in computers and coding, but then they got even higher at the end,” said Shepherd, who is watching how that varies with the public school students currently enrolled in the course.

Krug, who is from Brazil, presents two-minute coding lessons during the Code Beats sessions. He is also surveying the students to gauge their computing enjoyment, confidence, sense of identity as computer users, and intent to persist in computing. He wants to present computers as a tool to solve problems or computational thinking. 

Krug and Shepherd will present their findings on the impact of the first study at a computer science conference in March. Another member of the Code Beats team is 2019 College of Engineering graduate Edtwuan Bowman, a church musician, who Shepherd credits for his ability to recreate the sometimes complicated and multilayered hip-hop melodies.

“Edtwuan just does a great job with making these beats. Like it would literally take me weeks to [code] a beat and he just turns out one or two of them in a week,” Shepherd said.

Shepherd said his years working in the computer industry before coming to VCU informed his approach to academia and made him more results oriented.

“In industry, publications are still important, but making an impact on products was equally, if not more important,” said Shepherd, a Richmond-area native. “So now I value publications, but I also value other impacts such as improving the community, making products that companies eventually productize, starting companies (e.g., Code Beats Inc.), and other nonpublication deliverables.” 

Shepherd plans to bring Code Beats to Chesterfield County Public Schools as an enrichment after-school program. He and Krug are also reaching out to work with Brazilian researchers to bring Code Beats to urban students. They plan to use Brazilian funk music to see if imparting technology with authentic, culturally relevant music makes an impact in exposing a population to critical coding skills.

“It’s challenging to do these projects because we are trying to break some barriers using music to teach computer programming,” Krug said. “You can really learn about computer concepts using different ways. For sure, I would use music to teach [computer] basics for my students in high school in Brazil, and maybe I could attract more students that are not so interested in how to create computer programs.”