Visual or Text Programming?

Karsten Schulz
Australian Computing Academy
4 min readJun 11, 2018

--

The Australian Curriculum: Digital Technologies specifies visual programming up until year 6 and general-purpose programming from year 7 onwards.

Visual programming languages are usually block-based. They have been developed specifically for teaching purposes and are generally not used in the industry. The curriculum defines visual programming as:

A programming language or environment where a program is represented and manipulated graphically rather than as text… Examples of visual programming languages include: Blockly, Alice, GameMaker, Kodu, Lego Mindstorms, MIT App Inventor, Scratch (Build Your Own Blocks and Snap).¹

This differs from that provided for general-purpose programming languages:

Programming languages in common use designed to solve a wide range of problems. They include procedural, functional and object-oriented programming languages, including scripting and/or dynamically typed languages. Examples of general-purpose programming languages include C#, C++, Java, JavaScript, Python, Ruby and Visual Basic.²

Blockly Chatbot from the corresponding ACA coding challenge

Visual programming languages address a key issue that all learners of languages face: vocabulary and syntax. So when we learn a new language, be it a programming language or a natural language such as French, we don’t yet know the words of the language (vocabulary) and how to put them together into valid sentences (syntax).

Visual programming languages come with a tray with available blocks from which students can choose. This is hugely important, as it frees students from knowing much upfront about the programming language. Instead, students can choose from a limited function set, which can grow as the students learn more about the language. We do this, for example, in the Blockly computing challenges that we develop at the Australian Computing Academy.

A Blockly tray tailored for the ACA Chatbot DT coding challenge, final question

Like a puzzle, Visual programming blocks only click together with other valid blocks, therefore reducing the number of syntactic errors that students can make whilst programming. If two blocks aren’t meant to go together, they won’t click. This significantly reduces cumbersome bug-fixing in student code.

General-purpose programming languages don’t have this feature, so students need to know which commands are possible and achieve what they need. This means doing a lot of experiments, online searches, reading documentation and looking at sample code from other developers to work out how to implement their solution. Stack Overflow is a popular place for both new and experienced developers to seek out answers to their coding questions.

So why should anyone move from visual programming to text programming, given that visual programming has the above-mentioned benefits? There are several reasons:

  1. Visual programs become large and cumbersome very quickly. This has to do with the additional space that blocks require compared to the corresponding lines of code. As most students work on relatively small screen resolutions and small screens, this means a lot of scrolling. As the former head judge of Young ICT Explorers, I have seen some very long and fragmented Scratch programs; often, a long visual program can be expressed in a much more compact way with a general-purpose text programming language, such as Python. These text programs are also easier to maintain. Here is an example:
Captain Featherbot implemented in Blockly (left) and in Python (right)

2. You learn a lot from making mistakes. Making a programming error and experiencing the program behaving in an odd way is the best way to learn about algorithms at greater depth. Sometimes, we even learn that our algorithms can do something we didn’t expect them to do. Bill Gates has been attributed with: “It is not a bug, it’s a feature”.

3. Visual programming locks you in, intentionally cocooning students into a safe world with tight constraints; tools such as Scratch are great for multimedia and game projects, but other things like embedded systems projects are harder (sometimes impossible) to do. General-purpose programming has access to all the bells and whistles other developers have made available through their own code and libraries.

4. Since general-purpose programming languages aren’t restricted, they develop skills that can be easily applied to learning in other subjects. This means students can engage with mathematics, science, arts and language in ways not possible without the ability to process data without restriction.

5. The industry uses general-purpose programming languages. This is true, but not the main purpose of the Australian Curriculum: Digital Technologies.

So, in summary, it makes good sense to start off our students with visual programming and then transition them into the open world of text programming as their confidence and competence grow.

¹ https://www.australiancurriculum.edu.au/f-10-curriculum/technologies/glossary/?term=visual+programming

² https://www.australiancurriculum.edu.au/f-10-curriculum/technologies/glossary/?letter=G

--

--