Using Blocks to Teach Coding to Novices Of Any Age
Using block-based coding environments, such as VEXcode, is an effective way to teach computer science to novice coders of any age1. Although many people view block-based programming as appropriate only for young students or informal learning environments, block-based coding actually supports students of all ages in learning to code.
At the 2023 VEX Educators Conference, Dr. David Weintrop shared an overview of his research supporting the use of block-based coding for beginning computer science students in his presentation “Computer Science Research in K-12 Classrooms”2. Dr. Weintrop’s work shows how block-based coding is a powerful tool for teaching beginner computer scientists, as it lowers students’ cognitive loads, increases engagement and motivation, and fosters students’ conceptual understanding of computer science concepts.
In his presentation, Dr. Weintrop described a study in which he worked with students taking an introductory Computer Science course in a large, urban public high school. The students, in three different sections of the same class, came in with the same minimal level of prior knowledge, and were taught with the same curriculum, by the same teacher, and using the same coding environment. The only difference was each group used a different coding method - text based, block based, or a hybrid of the two. After the five-week curriculum was complete, the students who learned using block-based coding scored statistically higher than those in the other groups.
Lower cognitive load for beginners
One reason using block-based coding with beginning coders is so effective is that it lowers cognitive load, allowing them to focus on the computer science concepts teachers want them to internalize. When beginning students learn to code using text, they must focus on a multitude of syntax details just to get the simplest commands to run correctly. This is illustrated by the image below of a very simple VEXcode VR Python project for a robot to drive forward for 200 millimeters and then turn right. In that simple project alone, students must be sure parentheses, colons, and underscores are in the correct place, that parameters are entered in the correct order, that all indentations are correct and that there are no misspellings! A mistake with any one of those details would cause the project not to run.
Coding with blocks, on the other hand, eliminates the need to focus on such details right from the outset. With blocks, students are choosing from a Toolbox of command options, rather than recalling commands from memory and typing them out perfectly. Blocks are easy to read – they are much more like spoken language, and can be read from left to right, top to bottom. The blocks stack so that students do not need to worry about indentation, and know that the project will flow as intended.
The image below is of a project that has the robot behave just like the Python project above, but a novice coder can easily drag out blocks, stack them together, change parameters as needed, and focus on understanding the sequencing involved.
In his presentation, Dr. Weintrop described another study in which he looked at students taking AP Computer Science Principles courses, to see if using block-based instruction and assessment affected their performance on the AP exam3. He found that all students performed better on the block-based exam questions, and that students from populations historically excluded from computer science instruction, such as minority students and females, found even greater benefit from block-based instruction and assessments.
Increase motivation and engagement
Additionally, coding with blocks can increase students' motivation and continued engagement with computer science4. With blocks, a fast visual feedback cycle, like watching a virtual robot’s behavior in VEXcode VR, along with the ease of modifying blocks projects, allows students to have successful coding experiences that validate their learning.
When coding with text, novices often face mystifying compiler errors due to incorrect syntax, or misspellings. One tiny mistake can cause a problem not to run, which can be overwhelming and frustrating. These frustrations can build up quickly, and the feedback students may internalize is that computer science is too difficult, and therefore not for them.
Block-based coding is designed to avoid this. Because block shapes fit together only in specific ways, it is impossible to make a compiler error. For example, when coding in blocks, it is impossible to put an oval shaped reporter block as a condition into the hexagonal [Wait until] block. Only a hexagonal block will be accepted. (see image below), because they will not fit together. While a block-based coding project may not behave as intended, students are able to easily troubleshoot the logic of their project rather than fight with syntax.
Promote conceptual understanding of CS
When students learn to code using blocks, complex computer science projects are more easily understood. A conceptual understanding of loops, conditionals, algorithms and variables can be developed in a block-based environment, because coding with blocks lowers the barrier to those concepts when cognitive load is lowered and students’ motivation and persistence are increased. In the presentation, Dr. Weintrop shared how students' perceptions of block-based programming bears this out, as shown below.
As explained in the presentation, block-based coding is a powerful tool that allows students of all ages to learn introductory computer science. The idea that high school, or older students must start coding in text does students a disservice. After all, if a high school student was just starting to learn to play the piano, you would not start them out by insisting they play Beethoven sonatas because they are “real” piano pieces. They would learn by using the tools of scales, arpeggios and introductory songbooks – very “real” scaffolding needed for successful piano playing - why not give computer science learners the same opportunity to use the right tool for the job!
To view the presentation and learn more about Dr. Weintrop’s work, see this video from the 2023 VEX Educators Conference in the PD+ Video Library. Want to learn more about teaching with VEXcode VR and why starting students out with block-based coding is so powerful? Check out the new PD+ Masterclass Making the Most of Teaching with VEXcode VR. And, if you want to talk with a VEX Expert about anything in this article, sign up for a 1-on-1 Session or post your question in the PD+ Community.