Stop Teaching Code. Solicit Predictions Instead. 

While browsing Reddit (as all good stories begin), I came across this article posted about effectively teaching people to code. As a freshman who came in with the intended major of computer science, I’ve sat in my fair share of introductory coding classes. From learning Ruby and RoR at ages 14-15, to VIsual Basic for two days before dropping CP1 in high school, to CSC116 at NCSU with amazing teachers, I’ve seen a plethora of teaching styles with varying degrees of effectiveness. I decided to compare these to what the article’s author argues is the best way to teach a student to code.

Image result for computer science comic

AbtruseGoose Comics

Think and Do, Don’t Tell and Do.

Something interesting about my teachers have been that Ramiro, Mr. Pace, and Professor Akram weren’t teaching programming two years before I sat in their class, and even in the short time I’ve known them, I’ve seen their teaching styles evolve. The author, Jeff Olsen, recounts how he shifted away from “The Academic Model” after seeing it teaches memorization, not application. 

The Academic Model is: define vocabulary, show an example, and have the students create an example. Olsen’s critique of the model is that the cycle required more memorization than thought, meaning students had more trouble applying it. 

Prediction First

Olsen instead presents a prediction-first model. Show an example and have students guess what the code does. Then he directs students to talk to a peer about it; no terminology, no guessing syntax. Then the program is run and the output is examined. 

“What I’m driving at here is that cooking is to chemistry as coding is to computer science.”

My Experience (this is when the blog gets too long)

The Academic Model: I’ve seen the “explain, I do, you do” academic model in the classroom. It’s what is most often used in math classes, and effectively, but kids don’t grow up with computer science. The field requires you to think differently, many times in terms of object-oriented problem solving and other things that just aren’t *how we think*. I think that NC State’s CSC116 classes are based on this model, making them somewhat ineffective. 

The slides (which I assume are discipline-wide), start off with a title “ARRAYS”, “CONDITIONAL STATEMENTS”, “SOFTWARE DESIGN”, etc. They then get into a real-world example, the syntax, an example the teacher goes through, and an example for you. It starts off with terminology, and then why we’d use it, and then the syntax. The examples they use are what Olsen would call a “bad example”. For example, when learning about classes, we made a Car class. Olsen would criticize this because cars exist in real life, not on your computer. 

The real-world examples often encompass this: things we wouldn’t code. On the other hand, there are a couple of vocal students in our class who ask questions about every two minutes. Yes, it is probably exhausting for the teacher, but I think this combats the academic model. It shows engagement, gets the class to think of different possibilities, and breaks from “memorization” to a more Socratic-based classroom environment. 

Make Anything: In my two days of Computer Programming 1, I grew to love the way Mr. Pace taught. I actually dropped the class because I felt that I could test out of it, and the programming language was outdated (2007 Visual Basic in 2016). The reason I liked the teacher’s teaching style was that, yes, he had to follow slides, and he admitted it. 

I remember he dedicated the first couple of classes to “Try to build something, anything”. (This was possible in VB because it had drag and drop options for elements in the Visual Studio IDE). Getting students to just start creating and ask questions later meant no jargon, just application. Eventually, he got into the most boring, Wake County created computer science slideshows, but he emphasized the application above the slides. 

Let’s Make Twitter: My first coding class was in Ruby and applied the academic model. Though my second class, we worked on a semester-long project and created Twitter in RoR following the “Hartl Tutorial”. The tutorial introduced an issue, introduced a model to apply, and then how to code out. I think it was somewhat effective, it was good to see the application, but it led to memorization. It wasn’t until I started web development for real-world projects that I really had to problem solve on my own. Luckily, this was an extension of the class, so students would be forced to problem-solve… eventually. From what I hear, the classes have evolved to include mini-projects each class guided by the instructor. 

So what was effective for me? Well, every student is different. I think each method has its merits, but I personally feel that my knowledge in computer science grew most when I 

a. Started working on freelance web development and had to problem-solve without the “teacher’s help”

and 

b. When Alex and Sankalp ask a billion questions in CSC116 

I should note Pace’s class would’ve been more effective if I didn’t drop it after 2 days*

Ultimately, I’ve never experienced someone teaching me through the Prediction-First model. Though it does present good points: terminology is intimidating, memorization is not problem-solving, and traditional academic models can be used for every subject. You don’t learn reading comprehension through memorizing vocabulary, and you don’t learn to code through memorizing syntax. Accessibility to computer science education is a big problem in the United States, making sure the classes are effective is a whole other dilemma. 

Original Article: https://blog.upperlinecode.com/stop-teaching-code-a1039983b39