Why chemists should learn to code

An image showing chemistry coding

Source: Based on a © Shutterstock image

A valuable skill for tackling unique research problems

When I started my undergraduate chemistry education, a course in computer programming was not a degree requirement, so most students did not complete one. Instead, my peers and I relied on software applications for coursework that demanded quantitative analysis. And while we could have strayed from software tools and written code to do our calculations, we were not familiar with computer programming; it was not among the skills that comprised our chemistry toolkit. Late nights completing data analysis with my lab partners involved troubleshooting errors in spreadsheets, not debugging code. But if we had gained experience with programming like our peers studying physics or engineering, we could have more effectively handled laboratory data and performed quantitative analysis.

In graduate school, some students wrote code for their research – it became essential for my PhD in theoretical chemistry. Still, it was limited to those in heavily quantitative specialties, mainly physical and analytical chemistry. My peers’ experiences as undergraduates were like mine. None had completed any training in programming, and those now writing code for their research were self-taught.

My PhD advisor helped me start coding by recommending a programming language and providing informal assignments. Through this approach, I learned to code with a goal in mind, and found resources to tackle the problems as needed instead of aimlessly studying a language. After some practice, I gained confidence in my ability to write code that produced sensible results (at least after debugging) and switched to a different language for my research.