Word Nerds May Be Faster at Learning to Code than Math Whizzes

spainter_vfx/Shutterstock.com

Programming involves creating meaning by stringing symbols together in rule-based ways.

A natural aptitude for learning languages is a stronger predictor of learning to program than basic math knowledge, or numeracy, according to new research.

That’s because writing code also involves learning a second language, an ability to learn that language’s vocabulary and grammar, and how they work together to communicate ideas and intentions. Other cognitive functions tied to both areas, such as problem solving and the use of working memory, also play key roles.

“Many barriers to programming, from prerequisite courses to stereotypes of what a good programmer looks like, are centered around the idea that programming relies heavily on math abilities, and that idea is not born out in our data,” says lead author Chantel Prat, an associate professor of psychology at the University of Washington and at the Institute for Learning & Brain Sciences.

“Learning to program is hard, but is increasingly important for obtaining skilled positions in the workforce. Information about what it takes to be good at programming is critically missing in a field that has been notoriously slow in closing the gender gap.”

The research examined the neurocognitive abilities of more than three dozen adults as they learned Python, a common programming language. Following a battery of tests to assess their executive function, language, and math skills, participants completed a series of online lessons and quizzes in Python. Those who learned Python faster, and with greater accuracy, tended to have a mix of strong problem-solving and language abilities.

Learning to Code and Cognitive Skills

In today’s STEM-focused world, learning to code opens up a variety of possibilities for jobs and extended education. Coding associates with math and engineering; college-level programming courses tend to require advanced math to enroll and they tend to be taught in computer science and engineering departments.

Other research, namely from psychology professor Sapna Cheryan, has shown that such requirements and perceptions of coding reinforce stereotypes about programming as a masculine field, potentially discouraging women from pursuing it.

But coding also has a foundation in human language: Programming involves creating meaning by stringing symbols together in rule-based ways.

Though a few studies have touched on the cognitive links between language learning and computer programming, some of the data is decades old, using languages such as Pascal that are now out of date, and none of them used natural language aptitude measures to predict individual differences in learning to program.

So Prat, who specializes in the neural and cognitive predictors of learning human languages, set out to explore the individual differences in how people learn Python. Python was a natural choice, Prat explains, because it resembles English structures such as paragraph indentation and uses many real words rather than symbols for functions.

To evaluate the neural and cognitive characteristics of “programming aptitude,” Prat studied a group of native English speakers between the ages of 18 and 35 who had never learned to code.

Before learning to code, participants took two completely different types of assessments. First, participants underwent a five-minute electroencephalography scan, which recorded the electrical activity of their brains as they relaxed with their eyes closed. In previous research, Prat showed that patterns of neural activity while the brain is at rest can predict up to 60% of the variability in the speed with which someone can learn a second language (in that case, French).

“Ultimately, these resting-state brain metrics might be used as culture-free measures of how someone learns,” Prat says.

Then the participants took eight different tests: one that specifically covered numeracy; one that measured language aptitude; and others that assessed attention, problem-solving, and memory.

To learn Python, the researchers assigned participants 10 45-minute online instruction sessions using the Codeacademy educational tool. Each session focused on a coding concept, such as lists or if/then conditions, and concluded with a quiz that a user needed to pass in order to progress to the next session. For help, users could turn to a “hint” button, an informational blog from past users and a “solution” button, in that order.

From a shared mirror screen, a researcher followed along with each participant and was able to calculate their “learning rate,” or speed with which they mastered each lesson, as well as their quiz accuracy and the number of times they asked for help.

After completing the sessions, participants took a multiple-choice test on the purpose of functions (the vocabulary of Python) and the structure of coding (the grammar of Python). For their final task, they programmed a game—Rock, Paper, Scissors—considered an introductory project for a new Python coder. This helped assess their ability to write code using the information they had learned.

Language Aptitude Scores and Programming

Ultimately, researchers found that scores from the language aptitude test were the strongest predictors of participants’ learning rate in Python. Scores from tests in numeracy and fluid reasoning also associated with Python learning rate, but each of these factors explained less variance than language aptitude did.

Presented another way, across learning outcomes, participants’ language aptitude, fluid reasoning and working memory, and resting-state brain activity were all greater predictors of Python learning than was numeracy, which explained an average of 2% of the differences between people. Importantly, Prat also found that the same characteristics of resting-state brain data that previously explained how quickly someone would learn to speak French, also explained how quickly they would learn to code in Python.

“This is the first study to link both the neural and cognitive predictors of natural language aptitude to individual differences in learning programming languages. We were able to explain over 70% of the variability in how quickly different people learn to program in Python, and only a small fraction of that amount was related to numeracy,” Prat says.

Further research could examine the connections between language aptitude and programming instruction in a classroom setting, or with more complex languages such as Java, or with more complicated tasks to demonstrate coding proficiency, Prat says.

The Office of Naval Research funded the work.

This article was originally published in Futurity. It has been republished under the Attribution 4.0 International license.

X
This website uses cookies to enhance user experience and to analyze performance and traffic on our website. We also share information about your use of our site with our social media, advertising and analytics partners. Learn More / Do Not Sell My Personal Information
Accept Cookies
X
Cookie Preferences Cookie List

Do Not Sell My Personal Information

When you visit our website, we store cookies on your browser to collect information. The information collected might relate to you, your preferences or your device, and is mostly used to make the site work as you expect it to and to provide a more personalized web experience. However, you can choose not to allow certain types of cookies, which may impact your experience of the site and the services we are able to offer. Click on the different category headings to find out more and change our default settings according to your preference. You cannot opt-out of our First Party Strictly Necessary Cookies as they are deployed in order to ensure the proper functioning of our website (such as prompting the cookie banner and remembering your settings, to log into your account, to redirect you when you log out, etc.). For more information about the First and Third Party Cookies used please follow this link.

Allow All Cookies

Manage Consent Preferences

Strictly Necessary Cookies - Always Active

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data, Targeting & Social Media Cookies

Under the California Consumer Privacy Act, you have the right to opt-out of the sale of your personal information to third parties. These cookies collect information for analytics and to personalize your experience with targeted ads. You may exercise your right to opt out of the sale of personal information by using this toggle switch. If you opt out we will not be able to offer you personalised ads and will not hand over your personal information to any third parties. Additionally, you may contact our legal department for further clarification about your rights as a California consumer by using this Exercise My Rights link

If you have enabled privacy controls on your browser (such as a plugin), we have to take that as a valid request to opt-out. Therefore we would not be able to track your activity through the web. This may affect our ability to personalize ads according to your preferences.

Targeting cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Social media cookies are set by a range of social media services that we have added to the site to enable you to share our content with your friends and networks. They are capable of tracking your browser across other sites and building up a profile of your interests. This may impact the content and messages you see on other websites you visit. If you do not allow these cookies you may not be able to use or see these sharing tools.

If you want to opt out of all of our lead reports and lists, please submit a privacy request at our Do Not Sell page.

Save Settings
Cookie Preferences Cookie List

Cookie List

A cookie is a small piece of data (text file) that a website – when visited by a user – asks your browser to store on your device in order to remember information about you, such as your language preference or login information. Those cookies are set by us and called first-party cookies. We also use third-party cookies – which are cookies from a domain different than the domain of the website you are visiting – for our advertising and marketing efforts. More specifically, we use cookies and other tracking technologies for the following purposes:

Strictly Necessary Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Functional Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Performance Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Social Media Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Targeting Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.