A simple code for collegians: programming for all

Line items: There's something for everyone in coding, a skill suited to virtually all occupations, according to Adelphi University Associate Professor Matthew Wright.

Has higher education gone soft on coding?

Isolated in our computer science departments, it’s not reaching the wider student audience I believe it should.

At Adelphi University, where I chair the Physics Department, teaching coding to all students – STEM majors, humanities majors and health-profession majors – is an experiment I have tried and have personally seen succeed.

Computer programming is in high demand in the workplace, and it’s a 21st century skill our students will need in every possible career in the future. Knowing how to “think like a developer” is a useful career skill – in most businesses, you will need to work with software and hardware development at some level.

And with artificial intelligence on the rise, learning coding protects our students in the workplace, helping them to be highly valued employees in almost any field.

Matthew Wright: Coding 101.

Programming languages such as Python and MATLAB make it easy to work with code. It is straightforward to write a quick script and turn something abstract, such as a mathematical equation, into something actionable, like a computer animation that can spin, flip or rotate.

The most important math skill that every college student should understand is exponential growth. This is a concept ideally suited for a lesson in coding. For a General Education class I taught to many non-STEM majors with little to no experience with programming, we worked in MATLAB and walked through how a person would determine how much money is in their bank account with a fixed interest rate – a very simple calculation with a handful of lines of code.

We also did an experiment in which we grew some bacteria with the help of our amazing Biology Department. The students had to take the model we developed and manipulate it to match the population of bacteria.

From a coding point of view, the calculations were simple, but students were able to see and extrapolate various “what if?” scenarios by changing parameters in their code. As a result, we were able to have an intense discussion about the world’s population growth. It was interesting to see how people’s opinions changed when they understood how the concept of exponential growth really works.

Monte Carlo calculations are another excellent coding experience for every student. Think gambling (that’s where the name comes from). I had the students – even humanities students – create mazes for mice, and asked them how long it would take the mice to run through each route. We chose this problem as a class and we had to reach the conclusion together, working through the idea and code, bottom-up.

To be fair, the chemistry, nursing and history majors freaked out when I started them coding. But by learning with them, and helping them to overcome their fear, we were able to conquer that, step-by-step.

In the end, they all “got” coding and their confidence was high. Initially, one of the psychology majors was vocally against the idea of coding, but ultimately, wrote me this email: “If you ever want me to convince your students the struggle is worth it, I’ll come and hassle them until they realize it.”

One of my nursing students did a calculation of how viruses spread. Isn’t that awesome?

Professors should understand going in that there’s a barrier to teaching coding: Students – and faculty, too – think they need to know this skill before it can be taught. That’s simply not true.

I rather believe it to be more like a language. The best way to learn it is to jump in and do something useful with it.

My advice to those teaching code to every student is: Dive right in to juicy problems. Challenge your students. Challenge yourself. Even if you are not a programming expert, the scripting languages are set up for beginners. There are plenty of sites and tutorials online to give you enough knowledge to get started.

Often, the code that we write in class is less than 20 lines long. However, it is such a powerful experience for students’ learning that they will be thanking you for years to come.

Matthew Wright is an associate professor and chairman of the Adelphi University Department of Physics.