Patch is a free and open-source online coding environment built to help Scratchers transition their skills to Python.
Many young learners start with a highly intuitive learning approach to coding through Scratch, a block-based graphical programming language. Making the transition from Scratch to text-based programming languages can be hard since learning the formal syntax that is required can be a significant roadblock.
Python is often the first programming language recommended after Scratch because of its relatively simple syntax and popularity as a scripting language. However, for those who started with Scratch, their first experiences with Python are often frustrating; after having dozens of visual blocks to build from, being met with a blinking cursor on a blank screen is intimidating leading to a distinct loss of agency between the two experiences. Modestly skilled Scratch users can create almost anything their creative minds can conjure while those same users must slog through a slew of step-by-step extremely structured instructions to develop equivalent outputs in Python. While many core programming concepts can be naturally translated from Scratch into Python, there is still a significant loss of the learner’s agency due to the amount of new syntax, vocabulary, and libraries that a young learner must grasp to begin exploring Python.
Patch leverages a fundamental teaching approach that we have honed through BX Coding camps. When making the transition from block-based programming to text-based programming, we create an explicit correlation between Scratch blocks and functions in the text-based programming language to which students are transitioning. For example, a simple connection can be made between the ‘Say’ block in Scratch and the ‘print’ function in Python. Through our own experiences of teaching coding, we realized that contextualizing the many new challenges of Python with a set of familiar functions can greatly improve the student experience. Notably, this has been validated by a formal study of how such transitions can improve student self-efficacy in coding such as this case study.
Patch aims to integrate this teaching approach into an online tool optimized for helping young computer scientists learn Python syntax. Patch exposes the exact same API used for Scratch blocks except through a Python library allowing young computer scientists to use Scratch blocks in a “1-to-1” manner in Python. Consequently, young computer scientists who are interested in beginning with Python and are familiar with Scratch can leverage their knowledge of the Scratch block library. As a result, there is less strain on the transitioning student to learn the new vocabulary of a different library. This reduces frustration and allows young coders to focus on the other more substantive and rewarding challenges of text-based programming.
Scratch is a highly accessible tool that is widely used in CS education. For many young learners, it is their first introduction to programming. By the time a student has progressed to the point where they are ready to explore text-based programming, they have become familiar with an enormous amount of Scratch concepts and vocabulary utilized within the tool itself. While some of these concepts can clearly be generalized and used in text-based programming, there is an unintended consequence of Scratch’s highly intuitive, visual approach: almost all of the vocabulary is unusable during the transition. Patch offers an accessible online tool to leverage students’ existing knowledge of Scratch vocabulary and ease the challenging task of learning the syntax of Python. The result is a learning environment that encourages more creative exploration of Python in a less structured manner and in so doing, nurtures budding computer scientists’ self-efficacy and agency.
A stripped down version of the Scratch VM used to manage the state of the game view and interface with the Scratch Renderer component. Much of the functionality involving thread or execution management was stripped as the Patch worker will be handling most of this.
A web worker module that handles the execution and threading of the program. This module then connects to the Patch VM via a socket API to push block execution to the VM.
A small js module responsible for handling the pre-processing of the raw text inputted by the user.
A js module developed by Scratch to render the state of the Scratch VM
An informal diagram of how the components of Patch interact
As a POC we created a simple version of Patch implemented as a local python library. A short demo is included below. At this point in the development stage, the project was called Pyatch, so documentation and API’s refer to the project as such.
Patch is live! The completely in-browser MVP of Patch is up and we would love to hear everyone’s thoughts. If you have any feedback or questions, you can contact us at firstname.lastname@example.org.
Reach out to email@example.com! We welcome all collaborators!
Patch is built on top of the following amazing open-source projects: