Home Gotopia Articles Teaching Kids Ho...

Teaching Kids How to Code with Hedy

Learning to code entails learning both the programming logic and the syntax of the programming language. In most programmes, the initial classes teach C++. When kids learn to program they often use either a visual language like Scratch or a textual language like Python. But it’s not always the best way. Moving from a block- to text-based programming language can be challenging. That’s where Hedy comes in.

Share on:
linkedin facebook
Copied!

Read further

https://www.youtube.com/watch?v=ztdxlkmxpIQ&list=UULFs_tLP3AiwYKwdUHpltJPuA&index=20

Learning to code entails learning both the programming logic and the syntax of the programming language. In most programmes, the initial classes teach C++. When kids learn to program they often use either a visual language like Scratch or a textual language like Python. But it’s not always the best way. Moving from a block- to text-based programming language can be challenging. That’s where Hedy comes in. 

Named after Hedy Lamaar, Hedy is a language designed specifically for teaching kids to how to code. It addresses the issue of syntax complexity by building multiple levels of complexity into the language over time. Instead of providing the full features of the language right away, Hedy takes a gradual approach and slowly becomes more complex as students work through the levels. It gains new features and eventually becomes more Python-like.

Open source and free to use, Hedy is available in seventeen different languages (including English, Spanish, Chinese and Hindi). It was launched in early 2020 by Felienne Hermans and since then almost 1.5 million Hedy programs have been created by children worldwide.

Felienne Hermans



At GOTO Amsterdam 2022, Hermans delved into the pedagogy behind Hedy and discussed the technical aspects of it.

Founder and former CEO of Infotron, a spinoff company of TU Delft that implements risk assessment software for spreadsheets, Hermans is currently a professor of Computer Science Education at the Vrije Universiteit Amsterdam. She was the referee at the FIRST LEGO League, where children build a robot from LEGO.

Other languages vs Hedy

The expectation when learning how to code is that we would just type in the code and eventually learn why things were required and how they worked.

The complex syntax of C++ is why Python is often the suggested language for teaching programming. The first code example, the basic "Hello World" program, looked like the example below.


#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

Here is the same example in Python;

print("Hello World!")

While the basic "Hello World" example in Python is much simpler, it still has complex and precise syntax rules. The print function requires parentheses and quotes around the string. This can still confuse those who have no experience with programming.

Getting code ready with Hedy

Felienne Hermans showcasing Hedy

The easiest way to get started with Hedy is to access the lessons on the Hedy website. This makes the learning process accessible to anyone with a web browser. It is also possible to download Hedy from GitHub and run the interpreter from the command line or run a local copy of the Hedy website with its interactive lessons. The web-based version is more approachable, but both the web and command-line versions support running Hedy programs targeted at its various levels of complexity.

Hedy doesn’t compete with Python, C++ or other languages as the language of choice for coding for real-world projects but it is an excellent way to teach coding. The programs students write as part of the learning process are real and possibly even complex. Hedy can foster learning and creativity without confusing students with too much information too soon in the learning process. Like math classes, which start with counting, adding, etc., long before getting to calculus, programming language syntax that must be followed precisely to produce even the most basic program.

How does it work? 

Hedy is still a work in progress. The website has already 23 levels and will add more in the future. To give you an idea, at level 1, a Hedy program can print a statement (which does not require quotes or parentheses), ask a question, and echo back an answer. Level 1 has no variables, no loops, and minimal structure. Echo works almost like a variable but only for the last user input. This allows students to become comfortable with basic concepts without having to learn everything all at once.

Felienne Hermans at the GOTO stage in Amsterdam

This is a level 1 Hedy "Hello World" program:
print Hello World

If a user mistypes prnt instead of print at Level 1, the compiler can tell the user how to fix it. It can tell the user that the name of the function is print rather than prnt. A traditional error message instead would be: prnt not defined, which is less useful.

Traditional error messages prove useful to those who are familiar with programming or its theoretical foundations. On the other hand, Hedy gives error messages that are relevant to everybody. The importance of Hedy is not necessarily the language itself but the teaching approach to introduce newcomers to programming, Hermans detailed during the talk.

This approach can be used in the learning phase for every language. For example, in case of DSL, you could create a tutorial that gradually introduces new concepts and also uses meaningful error messages that make sense to people just learning that language.

The later stages slowly introduce using quotation marks around strings, which makes variables function like they do in Python. Students are then taught the if/else functionality, a basic programming concept, which Hedy introduces without having to worry about complex syntax or overly precise formatting.

Felienne Hermans at GOTO Amsterdam

Just like Scratch, Hedy is available for free at hedycode.com and can be used in a browser. Currently, Hedy offers 23 levels, each lesson is teaching new commands and materials with instructions and assignments built in. An average level will keep your kids occupied for approx. 45-minutes. A login is not required unless kids want to save their programs.