Skip to main content

Block to Text Programming

When we move students on from block to text programming, we want to transfer the learning that they have made on block coding into text programming.   When we are transferring learning we want to transfer knowledge from one context into another. In moving from one context to another we need to think in an analogical manner such that when we know how to solve a problem in one domain we can use it to help us solve a problem in another domain. The use of analogous examples helps learners see the deeper structure. We do this by seeking out deep structures and remove the surface structure of a problem. This approach is called expansive framing and we have expectation of future use in a different context. In contrast, bounded framing does not have utility beyond the current learning. Current learning needs to make connections to earlier contexts from which learners are expected to transfer in knowledge to the new context. Transfer of learning does not happen by itself; the teacher needs to make the connections explicit.

Students learn programming better when they start with block-based programming (Grover, 2021) because block-based programming makes the bar to entry in programming more accessible. But students often find it difficult making the transition from block to text programming. There are lots of reasons why students find text-based coding more difficult including the need to memorise syntax and commands (Grover, 2021).

There are lots of approaches that we can take to help support students transfer their knowledge from block to text-based programming.  Firstly, we can show the equivalent code written in a block language side-by-side with code written in a text language. This has been shown to improve transfer of learning (Dann et al). Showing same algorithm but coded in different languages forms a mental mapping between the two languages (Wagner et al).  For example, we can see Scratch block code and the equivalent text-based Python code below.



print(“What is your name?”)

name=input()

print (“hello”, name)


One activity could be to get the students to match the corresponding line of code in each of the languages.  For instance, say in Scratch is the same as print in Python.  Another task would be to give students a piece of code in one language and ask them to translate into another language.  You could begin by asking student to covert from the text to block, and as they progress then can then convert from block to text.  Such scaffolded activities will reduce the load on working memory. By taking this approach we are focusing the attention of the pupils onto the deep structure.  In other words we are drawing attention to the underlaying programming concepts such as sequencing, input and output as in the example above. A natural step on from this is to get student to plan their code using Scratch before writing it in Python. There are also dual modality systems that allow code to be translated between text based and block languages that can be used in a similar way as we have demonstrated here with Scratch and Python.

Frame based editors are another way to bridge the transition from from block to text programming.  They combine block and text based editors where operations are represented by frames, with spaces to add values.

Similarly the use of prewritten reference statements in Micro Python (Python for the Microbit) which is itself a text based language but statements can be dragged into the editor in similar way as block programming and then modifying the values.  Such reference statements mean that there is no need to remember the operations or syntax.  The reference statements are like a cheat sheet in the sidebar of the editor.

 

We have also developed a similar drag and drop system here: Mango Python IDE

High level imperative programming languages possess the same concepts: variables, selection and iteration even if on the surface they look different.

Programming concepts are the deep learning, the idiosyncrasies of the languages are the surface learning and represents the barrier learning. Programming languages are concrete when we want abstract. By showing analogous situations in multiple languages students can separate the programming concepts from the language itself.

References

Dann et al, Mediated transfer Alice 3 to Java

Grover, 2021, Teaching and assessing for transfer from block-to-text programming in middle school computer science

Wagner et al, Using App Inventor in a K-12 Summer Camp

Comments

Popular posts from this blog

Mango Learning

We are a community of teachers that have developed extensive computing resources primarily aimed at the English secondary school curriculum that can be accessed here: www.mangolearning.academy .  Mango learning empowers teachers to deliver great lessons that explain complex ideas using clear and highly scaffolded teaching and learning resources. We are very excited to offer these resources for free to the community. These teaching and learning resources for computing are made by teachers for teachers and we understand the day-to-day challenges that teacher face.   The resources incorporate general and computing specific evidence-based pedagogy. We incorporated spaced retrieval practice though knowledge organisers, diagnostic questions and quizzes, for instance. We also incorporate ideas from cognitive load theory through lots of worked examples.   To help with coding we use PRIMM and block to text based pedagogical approaches.   To support literacy we address ...

Teaching Children to Read Code using Evidence-based Approaches

Before students can write code, they need to be able to read code. Computer science pedagogy is often based around the ideas of Piaget’s constructivism - where pupils develop their knowledge through exploration, and Papert’s constructionism - where pupils learn through creating artifacts. However, evidence has shown that learners need guidance to gain useful knowledge efficiently and to organise that knowledge in a clear and logical way. They need to be able to break a problem down, remove the unnecessary detail, find patterns and think algorithmically before they can start to write programs for solving problems. Just as we wouldn’t expect a young child to write prose before they can read, we need to provide guided approaches that use direct instruction and scaffolding to help our students read code before they can be expected to write code themselves. These guided approaches are needed just as much as, if not more than, creative discovery activities. Explain the code My first approach...

How to support your students to write code

For many children writing code can be a daunting prospect. To help children learn to write code more easily we can use a range of scaffolded pedagogies. Initially these approaches take ownership of the code away from the students thereby giving them confidence to explore and experiment with the code.   Gradually as the students learn more and more we can reduce the amount of support until they are able to write their own programs independently.   In a previous article we looked at approaches for supporting pupils to learn to read code that included activities such as explaining, predicting and tracing code, and live demonstrations with worked examples. This follow up article presents some approaches to support pupils with writing code. Fixing broken code Children can find and fix common syntax, runtime and logical errors in a piece of code. Errors might include missing brackets, missing speech marks, spelling mistakes and missing variables declarations, for instance. Th...