Teaching with Block-Based Programming Languages

Block-based language can play a crucial role in introducing students to computer science.

When I received my student teaching/field experience placement for the semester, I was pleasantly surprised to find that my schedule included two course sections of computer science: one intro class, and the other is AP Computer Science Principles. Both classes are introductory courses (no previous programming experience required), although I agree with the College Board’s recommendation that students taking AP CSP have algebra 1 credit as a prerequisite along with knowledge of the Cartesian (x,y) coordinate system. Most of the kids taking the intro (non-AP) course at my school are 10th graders, so just about all of them have obtained their algebra 1 credit by the time they start the class.

Both classes offer flexibility in how the courses are structured. My intro class follows the Microsoft TEALS curriculum which uses the Snap programming language. Our AP CSP course follows the Beauty and Joy of Computing (BJC) curriculum, which also uses Snap. All curriculum resources are adapted and modified for the needs of the students I teach, and it’s nice to have such a solid resource to refer to.

I first cut my teeth on computer programming as a first-year undergraduate student in 2013 using Java. I didn’t stick with computer science for my formal education, but chance and opportunity would play out such that I would later go on to take courses in Python and statistical computing with R. I was certainly never the best programmer in my class, but I thought that I learned tons and had a good deal of fun along the way.

I have moderately strong feelings that Python is a great first computer language. Sure, you lose some of the slightly lower level stuff that gets abstracted away for learners compared to a language like Java or C++. I know when I first started learning Java, some of the boilerplate stuff was pretty intimidating. Take for example, a standard first program in Java:

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}

Compared to the same thing in Python:

print("Hello, World!")

Most students will think: what the heck is going on in that second line of the Java example? One day students will understand what each bit of that line means, but most of the students I teach just need to see something accessible on their screen. More importantly, they need to see a coding project that runs to boost their confidence and inspire them to try and create newer, better things.

One really nice thing about the two courses that I teach is that educators have the flexibility to choose which programming language the courses are taught in. Normally, I’d proudly proclaim to the masses that Python is the best language for those new to computer science. I still think it works incredibly well for undergraduates, adult learners, and highly-motivated high school students. The more I learn about teaching computer science at the high school level, the more convinced I am that block-based programming with an introduction to Python as pacing/time allows is the best way to support and nurture a love of programming with this population. Near the end of the school year, my students will get to explore Python a bit and I’ll be curious to see what they think of it.

I used to look down on block-based programming languages like Snap and Scratch, but now that I’ve been using them to teach introductory high school programming for about a month I’m singing a different tune.

A simple random number game created in Snap. The program generates a random number between 1-10, and asks the user to try guessing the number until they get it right.

My students are excited to complete hands on projects because they can dive right into the Snap environment and try out new ideas and concepts. The visual nature of block-based programming helps students understand how different concepts and logic fits together, and honestly Snap feels more like a game sometimes rather than a proper programming language.

Will the next AAA video game title or technological breakthrough be coded in Snap? Absolutely not. But if I can use block-based languages as a tool to get kids excited about programming, to go on and create with languages like Java and C++ (or even just develop an appreciation for the role of computing in our society), then I think I’ve done my job as an educator.

Computer Programming, Revisited

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}

On a chilly evening in January 2014, I was a college freshman sitting in my lab section for CSC 150: Intro to Computer Science at the University of North Carolina at Greensboro. I logged into my assigned workstation and over the course of 30 minutes, I had produced my first ever computer program, the snippet at the top of this blog post.

The syntax appears quite strange to anyone that’s never dabbled in code, but it’s an incredibly simple program. Whenever this program is run, it prints the text “Hello, world” to the computer screen.

As things would transpire, I didn’t go on to become a computer science major — quite the opposite actually. I earned my baccalaureate degree in classical studies (as in the Greco-Roman world, not AC/DC or Shakespeare), and went on to earn my master’s degree in education. Even though I didn’t “stick” with computer science in terms of my academic or professional trajectories, my first exposure to the world of computer code sparked a keen interest that I would revisit six years later through an elective course at Indiana University.

A few nights ago, I came across some old computer programs that I had completed as part of an introduction to Python programming while in grad school. I had organized the files on my GitHub account, which is like a programmer’s version of Google Drive. I downloaded a few simple programs that I had made, and felt a familiar sense of curiosity and intrigue at seeing them come to life in the screen. The more I thought about it, the more that I realized that I had a keen interest in getting back into the world of computer programming. There are a few reasons for that:

  • I dabbled in computer science as an undergrad and grad student, and I really enjoyed the classes that I took. Computer programming exists at a perfect intersection between art and science, and it always appealed to my brain in a unique way. There was always a thrill around getting a program to do exactly what you want it to do, even with the frustrations that come with debugging faulty logic.
  • New York City schools are making a big push for computer science, and I’m fairly confident that I’d like to obtain an additional license in this area. I can only imagine how awestruck I would have been if I knew about programming in high school, and I’d like to share that joy with students one day.
  • I’ve always been a deeply creative person, and coding definitely checks off that box.

I’m not sure exactly where my rekindled interest in computer programming came from, but I’m excited to get back into it, even if only as a hobby. Time is such a precious commodity these days, but I’m sure that I’ll make the most of it. I hope to share some occasional updates and code snippets here on the blog.