Learning Programming with Coral 

Avatar photo Dr. Alex Edgcomb

Seven years ago, Dr. Alex Edgcomb, Principal Software Engineer for zyBooks, met with zyBooks cofounders Professors Frank Vahid and Roman Lysecky to discuss a glaring gap they saw in computer science education – the lack of a truly accessible coding language for students with zero footing in programming. 

Sparked by that conversation, the programming language Coral was born. We spoke with Dr. Edgcomb about the motivation behind Coral and how universities across the country are now using the language as a successful onramp for teaching programming. 

In this post:

What was the motivation behind creating the Coral language

What do beginner programmers need to know?

Foundational concepts for beginner programmers

How do you teach these foundational concepts in Coral?

How do you use Coral in the classroom?

Visualization is a major aspect of Coral – how is it used?

What courses can benefit from Coral?

How to get Coral

Final thoughts

Coral in action

What was the motivation behind creating the Coral language? 

Dr. Alex Edgcomb: A consistent challenge that we were very much aware of was: How do you get students to both develop a very precise, specific way of thinking in code, and also learn the syntax of a programming language? These are two distinct things.

Thinking like a programming language transcends the actual language itself. What I mean is, an intro programming course can be taught in C or Python or Java… the list goes on. And each of these languages, which are used professionally, come with their own distinct syntax – a whole lot of different language constructs because professionals need those things. Beginners just learning coding, on the other hand, don’t need 95% of them. 

What do beginner programmers need to know?

What they need are some very basic constructs. For example, there’s input and output. Your program’s got to get some information in, and send some information out. Very fundamental. You need to know a little bit of math. You need to do some decision making in your program. And you need to understand looping, arrays, and functions. These are the most foundational parts of a computer science education. 


Foundational concepts for beginner programmers

  • Input/Output
  • Basic math
  • Decision making
  • Looping
  • Arrays
  • Functions 

How do you teach these foundational concepts in Coral?

Dr. Alex Edgcomb: We looked at the concepts one at a time and asked, what’s the easiest syntax? Pretty much every language uses a similar standard structure. We chose the simplest of those structures to build Coral. 

For example, in Python, indentation is how nesting is expressed, whereas other professional languages use curly braces and indentation doesn’t matter. But in early programming courses, instructors really care about students getting the indenting right, so we made it required for Coral. 

We went through the list of key syntax and made these kinds of decisions. We tried to balance keeping it really simple with making the underlying concepts transferable to a professional language. 

Even back in 2016 when we first met to map out Coral, we were clear that it isn’t a language you teach students and they go off and use it professionally; the purpose of the language is to launch a programming education.

“Coral isn’t a language you teach students and they go off and use it professionally; the purpose of the language is to launch a programming education.”

Dr. Alex Edgcomb

How do you use Coral in the classroom? 

Dr. Alex Edgcomb: zyBooks cofounder Dr. Frank Vahid pioneered an approach in his introductory CS classes at UC Riverside where he spends the first five weeks of the semester teaching Coral, and the second five weeks focusing on a professional language like C++. 

His students learn basic programming concepts with Coral, then apply those fundamentals to learn the syntax of a professional language, instead of trying to absorb both at the same time. Frank and his colleagues are still fine-tuning this approach, but the results have been really impressive. 

Visualization is a major aspect of Coral – how is it used? 

Dr. Alex Edgcomb: The language is expressed in two ways. One is textually, as code, like you’d see in a professional language. The other is pictorially, as a flowchart. This flowchart has a very particular structure – it mirrors code in a lot of ways. 

Flowcharts

The flowchart is a key feature of Coral. It helps students start thinking like a programmer. Once they understand a concept through a flowchart, they can switch to the code version of the application to understand how that works. 

We created a simulator where you can flip back and forth between flowcharts and code, and work on both sides and see how you’re writing code and how the flowchart represents programming logic. It starts to make a ton of sense. 

In fact, as a professional developer, I have that same kind of visualization – that flowchart – in my head when I’m writing code. It’s super important for students to develop this fundamental insight into the process. Professional languages by their nature don’t readily reveal this insight if you’re a beginner. 

Visualizing Memory

Another key benefit of the Coral simulator is that it helps students visualize memory. We actually show the variables in memory and how they’re being updated. You can step through your code line by line and see how a line of code changed memory or wrote to output, and so on.

Coral connects the dots; memory isn’t this hidden thing. This is huge. Professors use the learning power of hashing out memory on a blackboard. The Coral simulator bakes that in; enabling every program to be hashed out, modified, and then re-hashed. Especially insightful: Hashing out a program the student is actively writing or debugging.


Coral flowchart


What courses can benefit from Coral? 

Dr. Alex Edgcomb: As I mentioned earlier, we’ve seen great success introducing Coral to the first half of Introduction to CS, or CS1 courses. Another course that benefits from working with Coral is CS0, or introduction to programming for students who aren’t studying computer science or engineering. At many universities students from other disciplines will have a tech elective, and Coral is an ideal approach to teaching those students programming concepts. 

When we created Coral it was very important for us to make it available to anyone who wanted to teach with it. The simulator is available free on the Coral website. And we integrated Coral into our interactive Fundamentals of Programming in Coral zyBook. 


How to get Coral

Check out zyBooks Fundamentals of Programming in Coral or visit the Coral language website


Final thoughts 

Fundamentally, our key motivation behind creating Coral is to help the computer science instructor community. We see the evolution of Coral as truly a community effort, and we welcome all comments and feedback on the language. I’d love to hear from instructors about what works for them and how they’re using Coral in their classrooms. 

[You can reach Dr. Edgcomb by emailing officehours@zybooks.com]


Coral in action

In this video, Dr. Edgcomb demonstrates the power of Coral to teach fundamental programming concepts:

Avatar photo
Author Bio

Dr. Alex Edgcomb

Alex leads the Pedagogical Engineering team at zyBooks, developing interactive learning tools, simulators, and lab environments, as well as authoring tools that optimize productivity of authors. Alex enjoys working closely with authors and learning experts to build activities that are straightforward, promote many small steps, enable ample practice for students, and provide immediate, high-quality feedback. Alex joined zyBooks in 2014 after earning his CS PhD from UC Riverside. Alex has published over 40 research papers, mostly on web-based STEM education, including two best paper winners and two best paper nominees at the ASEE Annual Conference.