[Versão em português ainda não disponível para este post.]
Procedural literacy is a relevant topic in my research, which is about procedural expressiveness. I’ve been meaning to do an “Hour of Code” since it first came out, a couple of years ago. The recent release of a course based on the movie Star Wars: The Force Awakens seemed like a good opportunity for that.2
Note: this is not a “review” of the course. Instead, it’s a critical (albeit informal) analysis done in the context of my research.
I remember one of my first Computer Engineering classes, which was back in 1997 (!). The teacher stood in front of the class and asked the students to explain which commands they would give him if he was a robot, in order to make him open the door and leave the classroom (which in hindsight revealed much more of his inner thoughts than we could imagine at the time).
This would lead to a lot of confusion. One student would say “Walk 3 meters!”, and the teacher would walk towards him (instead of towards the door). Reset, try again. Another student would say “Walk 3 meters to the door!”, to which the teacher would reply “What is a Door?”.
Of course, confusion was the purpose of this exercise. This is actually a common way to introduce the concept of programming, which mostly involves making a stupid machine do smart things. He was probably aware that most of us already knew how to program. Still, a valuable lesson nonetheless.3
The course I tried at The Hour of Code began with the same exact lesson.
The Hour of Code uses a visual programming language similar to Scratch (MIT), in which code is built by snapping “bricks” into place – each brick representing a different function, variable attribution and so on.
Each course is structured in a series of smaller units – the lessons. In the start of each lesson the student is presented with a goal, and with instructions and tips on how to achieve it. Additional instructions and suggestions also come up during the lessons themselves, either as a reminder, or in response to certain actions from the student.
The course indeed takes about an hour to complete. I finished it sooner than that, even after a couple of browser freezes and crashes (what’s up with that?), but I’m not exactly their target audience. The idea of limiting the lessons to one hour, and emphasizing that when promoting the courses, is a wise move. It makes the tasks seem less overwhelming, which in turn makes it more likely for people to try it out, while still allowing enough time to go a bit beyond the basics.
Overall, I thought the course was a pretty good introduction to coding, although it did feel a bit unbalanced.
The Code Sleeps
The course starts off with a movement exercise, similar to the one I mentioned before. The student is asked to add the necessary commands to move BB-8 (a new robot that is introduced in The Force wakens) to the appropriate positions. This is a good start, since it shows that algorithms are basically a series of simple instructions put together.
However, the same simple lesson is then repeated many times – way too many. I understand you have to start with the basics, but I also think that there should be a steady increase in complexity, otherwise the student may get bored. I kept expecting the next lesson to finally begin showing how these simple instructions could be built up to more interesting and complex systems (which did eventually happen, although a bit too little too late, as I will explain further).
I like how the concept of functions is introduced gradually. First, in the form of simple commands, such as the instructions for movement. Then, later on, as an entity that could be “opened” and modified – for example, the student could build the movement function by associating it with the arrow keys in the keyboard.
However, the code written in one lesson was never carried on to the next one. This was probably implemented this way to keep things simple and avoid code conflicts in future lessons. But in a way this seems to contradict the very purpose of doing an interactive course such as this one.
Interestingly, although the code itself did not carry on between lessons, the behaviours that they where supposed to produce did. For example, after the lesson in which the student authored the movement functions, this behaviour would persist on to every following lesson (even though the code didn’t). This can be confusing to the student, since the course never makes it clear that the code is being reused in that manner.
Also, an additional confusion comes from the aforementioned fact that the code written by the student for the functions is actually not being reused. The behaviours being displayed result from a default (or “correct”) version of the required code. So, if a student decided to implement one of the functions in a slightly different manner – for example, having the arrows move the robot extra faster -, this alternative behaviour wouldn’t be reflected in the rest of the lessons.4
The Code Awakens
While I felt the pacing of the first lessons to be too slow, later on in the course the opposite happened. Suddenly many new concepts, functions and logic are introduced without much warning or explanation. For example, there is mention to a “timer”, and to functions that allow changing the map and the background graphics, which are never fully explained (at least not in a clear manner).
In a way, this does mimic well how computer programming actually works in practice. Rather than knowing every function and command by heart, a good programmer needs to be able to figure things out by experimentation. Still, I felt this happened in a way that was too rushed, specially considering the pace of the first lessons, and the intended audience.5
Luke.parent = Vader
As I mentioned earlier, this is not supposed to be a review, but an informal analysis of the course in the context of my research. I focus on the less straightforward and more problematic aspects because this is where the most interesting discussions and insights are more likely to emerge.
I thought the course was very good and effective, despite the minor issues and annoying bits (most of which I mention here). Also, whenever the student does gets stuck there is always a popup message explaining what is missing, or how to solve the problem.
The Star Wars theme also fit well with the activities, specially the sound effects. They even use the music played by the band in the original cantina scene.
After finishing the course, the student gets an e-certificate, and is allowed to create a game from scratch. This can then be shared with a link that allows people to play the project, and also view and modify its code.6
Visit the Star Wars themed Hour of Code course here.
- The project has the support of names such as Mark Zuckerberg, Bill Gates and Barack Obama (as well as, according to their website, many “celebrities”). Often they bring in partners such as Disney, Rovio (Angry Birds) and Mojang (Minecraft) for customized lessons in order to attract the younger audience. [↩]
- I should also mention that, although Code.org is about coding in general, this course (as many others) is focused on game programming. This is understandable, since games involve a very complete set of concepts from graphics and sound to logic and interaction. Also, this is a much more interesting topic for kids. [↩]
- When I was 10 years old I was already making games and experiments in BASIC on my Commodore 64. Nowadays, despite my degree in Computer Engineering, my programming skills are very basic. However, I do still dabble and experiment with some programming languages, mainly due to my research in computer art, but also for my own creative purposes. [↩]
- The student actually doesn’t have access to most of the functions in the games, such as the ones that guide the behaviours of the enemies, which include path-finding and attack patterns. Again, these limitations are understandable due to the introductory nature of these courses. It would be too much to have the student access every single bit of game logic, such as the graphics and sound engine. However, I wonder if they should be able to access at least some of the rules and behaviours – the ones that are more directly related to the game’s design itself. It seems to me that it would be best to have only very simple behaviours available, which could all be authored by the student, instead of complex behaviours that are hidden. Considering the modular logic of how programming works, it wouldn’t be so far-fetched to have the student author some pretty complex behaviours, by doing it gradually, one function at a time. [↩]
- Another confusing aspect I found in the structure of the course was about what was exactly required for the student to “pass” each lesson – is it writing the correct code, or winning the actual game that is generated by said code? [↩]
- If you want to check out my own creation, prepare for some soft robot-torture-porn. PS: since I am more interested in systems than in the specificity of interactivity, you can’t really control anything – but there are some interesting behaviours in play. [↩]