|Block Based Languages Are Best|
|Wednesday, 31 May 2017|
If you program and have ever looked at a block-based language such as Scratch you might not have been impressed. The immediate impression is that it isn't programming. If you have tried to teach programming, on the other hand, you may well think better of block languages. A new study suggests that they are better than you think.
It can be difficult to take block languages seriously because they look more like a child's game than a programming language. How can you possibly do anything useful in that! However, if you look at some of the things that beginners create using nothing but block languages you can see at once that it is very possible to create non-trivial programs using one.
A new study by David Bau, Jeff Gray, Caitlin Kelleher, Josh Sheldon and Franklyn Turbak from MIT CSAIL, University of Alabama, Washington University and Wellesley College provides evidence that block languages have an edge over more traditional text-based ones:
We believe the learnability of blocks languages arises from how they address the usability challenges underlying these three learning barriers:
1. Learning a programming vocabulary is hard. Blocks simplify this problem because picking a block from a palette is far easier than remembering a word: blocks rely on recognition instead of recall.
2. Code is hard to use because it presents a high cognitive load for new programmers. Blocks reduce the cognitive load by chunking code into a smaller number of meaningful elements.
3. Assembling code is error-prone. Blocks help users assemble code without basic errors by providing constrained direct manipulation of structure (e.g., two incompatible concepts do not have connecting parts).
This is great for the beginner but once you start to write real programs there are disadvantages. For instance, to enter a simple arithmetic expression using blocks is harder than simply typing it out. Making small changes is also harder.
...researchers observed that visual programming languages can have a higher viscosity than text code because they make small changes harder
Beyond viscosity, blocks environments can have several other usability disadvantages compared to textual programming languages:
Low density: blocks take more space on the screen than equivalent text code.
Search and navigation: it can be challenging to find and navigate to the relevant part of a blocks program in a 2D workspace, only part of which may be visible.
Source control: collaboration and version control systems are difficult to use without a text representation.
Greenfoot’s Stride editor combines textstyle editing for expression-level details with drag-and-drop blocks for higher-level program structure.
Pencil Code provides bidirectional switching between blocks and text. Mode switching allows users to learn with blocks and edit quickly with text.
Single mode structured editors have the advantage of a conceptual model free of syntax errors, because the primary object being edited is the abstract syntax tree. However, to maintain consistency, many kinds of textual edits must be prevented, and other edits may require special tree editing commands. These constraints raise editing viscosity, and they may present additional cognitive barriers.
Block code editors have uses other than just making languages easier to use. For example, by using a toolkit such as Blockly you can implement drag-and-drop configuration setting apps and other utilities. They make a good freeform user interface.
The last word should go to the study:
The art of programming is the original human-computer interaction, and it remains an unsolved usability challenge. We can still do more to make programming available to all.
Learnable Programming: Blocks and Beyond
Minecraft Code Builder In Beta
Choosing The Best Beginner's Programming Language
Getting started with MIT App Inventor 2
A Programmer's Guide to Scratch 2
Blockly Games Introduce Kids To Code
The Working Programmer's Guide To Language Paradigms
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Thursday, 01 June 2017 )|