Unlike Dart -- a possible replacement for JavaScript -- and Go -- a low-level but modern language that's very suitable for creating servers -- Google Blockly is a Web-based graphical programming language that intentionally resembles a jigsaw. You create programs by joining pieces together, and are restricted in the same way puzzle pieces are, by what fits where. This is an ingenious and easy to understand method of ensuring that the program is correct. It short cuts the process of having to learn correct syntax. If the pieces fit, the program works. Blockly is something of an experiment in teaching people to program. Instead of having to learn the intricacies of a language like JavaScript, you can show Blockly to teenagers or even younger kids, and visually explain the concepts and engage their brains. Visual Programming Languages have been around for some time. Wikipedia lists over 100 VPLs. The similarity between Blockly and MIT App Inventor are obvious. What makes Blockly a little different is that it's a code editor written in JavaScript, and is open sourced. That means non-Google developers can get involved and contribute back. Most importantly, Blockly programs can be exported as JavaScript, Dart, Python or XML source code. There's no importing into Blockly at the moment, but I'm sure some clever coder will devise a tool to allow it.

[youtube http://www.youtube.com/watch?v=IqjIC7OXGZA&w=560&h=315&wmode=window&h=315]

Test Driving

The Maze demo page lets you try Blockly by creating a program that moves a pointer through a maze. Initially it just has a Move Forward piece, and you have to click the Commands or Logic buttons to view all the available commands. You then select a command and drag it into place. This problem can be solved in a variety of ways. The shape of the pieces dictates what can and can't be used. When you drag a piece inside another, the enclosing piece expands so they fit cozily together. If there is a + in the shape as in the "if then" piece, clicking the + let's you configure it. Pieces that have a different colored word inside (like "forward" in "Move Forward") provide extra options. For example, you click "Forward" to get a popup that lets you select either "Forward" or "Backward" movement. It's a delight to play with. As the IDE executes each part of your program, that part is highlighted. It's not exactly debugging, but it lets you work out where things are going wrong. I reckon the Maze demo would make an excellent programming interview question. It's certainly something that would challenge a bright kid. As a way to get them involved, this is wonderful, and something that I'd have loved to have learned with with at an early age.

Related Links