In the fall of 2017, Quebec's digital strategy was unveiled. One of the objectives is to ensure the development of digital skills, among other things by learning programming. This file is intended as a tool to get acquainted with the development of computer thinking.

A joint dossier from Carrefour education and École branchée

by Adam Desjardins, computer science teacher,
Amy tran, computer science and mathematics teacher,
Marc-André Girard
, secondary school principal,
Beaubois College

 

Summary of the file

Introduction

Coding, programming and robotics
Coding and programming
Robotics
Historical
Why are we talking about it now?
Motivation, interdisciplinarity and digital literacy

The progression of learning in programming 

Some teaching strategies for approaching programming in the classroom
The modeling
Scheduling
Self-regulation
Fly with its own wings!

Computational thinking
Break down, structure and reformulate
Self-assessment - self-regulation

Development environments and programming languages
Programming languages vs development environments
Educational languages vs "real" languages
2 factors to consider when choosing a language
The syntax
Development environment

The little guide to educational robotics
Bee-bot and Blue-bot
Cubelets
LEGO Mindstorms EV3
mBot
Arduino
Raspberry Pi

Acknowledgments and references


 

Introduction

It is discussed in all schools. We sometimes say programming, coding or robotics. We even make competitions! These are components of a competence of the 21e century: the development of computer thinking.

This file, contrary to what one might think, is not intended only for teachers geek, but good for all those who want to explore what the world of education could look like in the not so distant future!


 

Coding, programming and robotics

Coding and programming

In education, these two terms tend to be used equivalently, which is not traditionally the case in computer science.

The programming often refers to the fact ofanalyze problems and solve them using algorithms, then translate these into one of the many existing programming languages. Those who occupy this function professionally are analyst-programmers. The function of programmer (without the part analysis) existed when the first computers arrived in the 1950s and are almost extinct today. Note that, in general, algorithms are methods of solving problems using different stages of processing a certain amount of data.

In general, when we talk about coding, we refer to the fact of translate an existing algorithm into a programming language. In short, the coding task is more an operation of translation than of reasoning in itself. In this file and in general in education, the term programming is preferred

Whether we are talking about coding or programming in a school environment, the pedagogical important thing is this: the more the task involves a large portion of analysis, the more we aim for the use of metacognition and the development of problem-solving skills. And this is precisely where the relevance of programming in a school context lies! We will come back to that.

Robotics

Robotics is one of the ways to apply programming concepts. In a pedagogical context, it makes it possible to concretize certain concepts which would often be much more abstract if they were taught in a formal or traditional way. In addition, some robotic applications used in schools require little or no in-depth programming knowledge.

Teaching programming concepts through robotics is a good place to start and prepares students to move on to a more formal programming level.

An interesting aspect of robotics is the variety of input devices (light sensor, distance detector, temperature probe, etc.) and outputs (motor, light, sound, etc.) possible. There is also a motivational element for the student in seeing the results of his programming directly and concretely through the actions of a robot.

Historical

Wanting to make learning programming accessible is an idea that is not new. For example, in 1964, the BASIC language was invented to introduce college students and has long been used to demonstrate the basics of programming.

The idea of formally teaching this subject is not new either. We only have to think of the Logo language. The first versions of this language were developed in the late 1960s and school-based experiments were conducted in the 1970s in a few schools in the United States. However, it was in the 1980s that attempts to establish a larger scale took place, particularly in the fifth and sixth year of elementary school, including in Quebec.

In Quebec, there has been no large-scale deployment of formal programming education, apart from the ISI (Introduction to Computer Science) training program created by the Quebec Ministry of Education. in 1982. These optional courses were offered to fourth and fifth secondary pupils, but have practically disappeared from schools. Moreover, without being the official reason for this disappearance, the cost of computers has long been a brake on the implementation of programming courses in Quebec schools.

Why are we talking about it now?

For several years, the growth of companies in the field of information and communication technologies (ICT) has created a demand for specialized workers in all sectors of IT, particularly in the development of software and video games. and communication solutions for individuals or businesses. The labor shortage predicted by several economic analysts in the fields of science, technology, engineering and mathematics (which we group together under the acronym STEM, or STEM in English) creates pressure on governments and on systems education. In 2012, Microsoft also suggested different avenues to strengthen training in STEM fields, particularly in IT. You can find out more by reading A National Talent Strategy: Ideas for Securing US Competitiveness and Economic Growth.

Whether or not this anticipated shortage becomes a reality, the idea of adding programming to primary and secondary education is already having an impact. For example, large companies like Google, Microsoft and Facebook fund the nonprofit Code.org, one of the main objectives of which is to promote the learning of programming in schools.

Notwithstanding the desire of large companies to have their workforce needs met, it must be recognized that the ability to solve problems and express solutions in a computer language is increasingly becoming a part of the spectrum. skills most useful in the labor market.

On a larger scale, it is a collective awareness that is taking place: new skills must be developed in students. For example, it is becoming more and more important for young people to develop an understanding of the tools they use on a daily basis in order to understand how they work, to maximize their use and to develop a critical look at this same use. In a way, this is a high level of digital literacy that takes place in the development of computational thinking.

Motivation, interdisciplinarity and digital literacy

The new needs of the labor market coincide with other human factors which constitute an unprecedented educational opportunity. The attraction of young people (and not so young) for video games is a striking example. Indeed, the programming game design is an interesting springboard for individuals, both motivational and educational. It is learning that clashes with what students are used to doing in class. In addition, the possibility of translating certain theoretical content through programming particularly appeals to boys. These learning situations lend themselves particularly well to interdisciplinarity and transversality. Himself, learning a programming language allows the development of a series of skills that can be transposed into several areas. For example, computer tasks fit naturally into those covered in math and science lessons. Many creative teachers even extrapolate these links in French, history and other subjects.

Isn't the omnipresence of digital technology in itself a valid reason to question what is behind the screen in order to understand how it works, and thus to evacuate the magical conception that we are? inclined to grant to these machines? Precisely, the programming courses will be able to reduce the effects of a potential “technological fetishism” (attraction for the “gadget”) and make it possible to keep a critical distance vis-a-vis the tools used daily.


 

The progression of learning in programming

Even before choosing a tool to teach programming, it is necessary to clearly define the extent to which one wishes to support the students in their learning. Defining the different phases of learning programming is a colossal task that is not yet completed as far as primary and secondary education is concerned, as research is still in its infancy in this field. Despite this, it is possible to define some learning elements by looking at what has already been done in the past and what seems to be working today.

Currently, the most popular platforms for learning programming all use more or less the same ways of doing things: sequential, procedural and event programming.

Sequential programming Procedural programming Event programming
Roughly speaking, sequential programming involves the definition of a "recipe" that the computer must follow in a predefined order. For younger students, this is a good place to start because at this level the programs are essentially recipes. In procedural programming, we create several "recipes", called routines or procedures. As this way of working is very modular, it allows a complex problem to be broken down into several simpler sub-problems. In event programming, procedures can be executed following certain user actions. An example of an event that can trigger the execution of a procedure is a mouse click on a button.

 

There are many other programming paradigms, such as object oriented programming which requires a greater capacity for abstraction. Here, the object represents a concept, an idea or any entity in the physical world, such as a car, a person or a page from a book. He has an internal structure and behavior, and he knows how to interact with his peers. It is therefore a question of representing these objects and their relations; the interaction between the objects via their relations makes it possible to design and realize the expected functionalities, to better solve the problem (s). It is possible, with some students at the end of secondary school, to approach this style of programming. In addition, it is even desirable that the students be exposed well in advance to certain concepts inherent in this way of programming.

In order to show as simply as possible what the progression of learning could be at the level of programming structures, here is a series of examples in pseudocode illustrating the first phases of learning:

Simple sequential procedure

It is often this step that we approach programming. A typical exercise would be to move a character in a maze, or even draw a picture. A program drawing an equilateral triangle might look like this:

Pen in writing mode
Advance 10 steps
Turn 120 ° to the left
Advance 10 steps
Turn 120 ° to the left
Advance 10 steps
Lift the pen

Simple repeating structure

At this stage, one could imagine that the student would have to write a program that moves a ball to the right by moving it 100 pixels (the pixel is a unit of measurement of the size of an image) in total. The pseudocode might look like this:

Repeat 100 times {
     Advance the ball one pixel to the right
}

When we add the repetitive programming structure, which makes it possible to execute one or more lines of code a determined number of times, it is effectively only used for this task. However, its interest will be revealed much later in the learning process, for example, in treatments involving indexed variables (such as x1, x2, x3… Xnot) and everything related to it, including strings and arrays.

Decision making

This new element allows the computer to make a decision based on information that is variable. For example, the fact of choosing at random the color of the pieces that a chess player should use:

Assign a random value between 1 and 2 to the variable x
If x is 1 then {
     the player has the white pieces
} if not {
     the player has the black pieces
}

This learning phase includes several cases of decision making: simple, binary or multiple. Here are different examples:

Simple case: If x then a.
Binary case: If x then a, otherwise b.
Multiple case: If x then a, if not if y then b, if not if z then c, etc.

 Pixabay

 

Repetitive structure with condition

This structure allows you to repeat instructions as long as a certain condition is met. For example, a program that moves a horse to the right until the finish line:

As long as the horse is before the finish line {
     Advance the horse to the right one unit
}

In order to be able to solve problems of different kinds, the pupil must be able to combine these programming structures. This leads us to define the pedagogical strategies allowing the development of real programming skills.


 

Some teaching strategies for approaching programming in the classroom

More and more teachers wishing to integrate programming into their pedagogical approaches come up against the fact that there are few didactic books for this purpose. So here are some ways to approach programming, without jeopardizing your classroom management!

The modeling

From the 1er primary cycle

Example of exercise

Here is a command that allows the sprite to ask a question:

Now, it's your turn to create a questionnaire!

The teacher can model the activity by presenting an example of programming and inviting the students to do the same, with little or no divergence from the imposed model. Cognitively, students are in contact with various elements related to logic, by developing skills in structuring procedures and, finally, by being made aware of the importance of a rigorous approach.

This teaching method is like a list of recipe instructions - students only need to follow them carefully to complete the task. In our opinion, this approach is more suitable for young people from 1er primary cycle. This is what we find most frequently in our schools today.

Scheduling

From the end of primary

Example of exercise

Here are 8 command blocks. Create a program using these 8 blocks ONLY. All blocks must be used and you can use a block more than once. Let your creativity flow!

With this second way of doing things, the student must choose a series of instructions making it possible to accomplish a task among those provided in advance by the teacher. The latter presents the function of a series of commands and suggests that the students put them in an appropriate order. Cognitively, this teaching method mobilizes the creativity of the young and allows to develop the prediction and anticipation of events. It is, in a way, the gateway to the development of computer skills, i.e. the ability to think sequentially to achieve a predictable result. Also, according to our experience, this way of doing things is rather motivating for the students since they can lead to a multitude of different results, which gives them a certain power in their own learning process.

In our opinion, this approach is particularly relevant for young people at the end of primary school. The latter are then more autonomous and, in the event of a blockage, they are not afraid to use a trial-and-error approach. In addition, since the written programs are unique to each student, a discussion on intellectual property is easily conceivable following the educational activities, not to mention that discussion or constructive criticism activities can also be held. What is important here is to allow the pupil to justify his choices and to explain them.

Self-regulation

At 1er secondary cycle

Speaking of critical thinking, here is a slightly more advanced approach where students are encouraged to deepen their knowledge of the different programming commands by analyzing a program already written and identifying key aspects.

As mentioned previously, the coding task is easily compared to a translation task. On the one hand, the teacher can present a program to the students and ask them specific questions about the various outcomes to be expected. This exercise in verbalizing abstraction also makes it possible, in a very interesting way, to develop the analytical skills of young people by dissecting the programming blocks and translating them into a more formal thought, ready to be reinvested in action.

Example of exercise

Here is a program which manipulates the value of the variable surprise. After execution, what is the value of surprise? Explain the process that leads to this result.

On the other hand, the teacher or tutor can present a program with technical errors to the students and ask them to correct them. This exercise is more commonly referred to as a activity of debugging. Cognitively, this approach promotes the development of self-regulatory skills, which are similar to metacognitive reasoning. Instead of seeing mistakes as disasters, this type of exercise invites students to learn and take advantage of mistakes to turn them into successes. In addition, the development of many other skills is encouraged, such as the ability to deconstruct a problem to identify all of its components and thus build an original and innovative solution.

This approach can be started with the students of 1er cycle in secondary school and, interestingly, it allows the development of several skills that can be transposed into other disciplines, in particular mathematics, science and ethics.

Robotics workshop (CC BY-NC 2.0) through  City Bassens

Fly with its own wings!

Finally, the teacher suggests that the students write their own program to accomplish a task. The teacher must adopt the role of observer and guide by inviting the student to think for himself about his own programming process: what were my mistakes and the obstacles encountered? How did I go about overriding them?

The teacher's role is also to create a community for sharing knowledge and learning within the classroom to encourage collaboration among students. How can they help each other overcome obstacles? Any advice to offer? Expertise to share?

Also, in order to explain the metacognitive processes of the student facing the task, it is recommended to adopt a rigorous methodology, such as keeping a logbook. This tool can collect research traces, design plans, progress report at each cycle, peer review, self-assessments, etc.

This way of teaching does not focus on learning blocks of code specifically, but rather on the development of a competence resulting from computer thinking in full autonomy.


 

Computational thinking

You may have heard of the computer thinking (sometimes called computational thinking), or its English form computational thinking. Few know it, but many practice it without realizing it. In fact, in 2006, Jeannette Wing has inspired a large number of educators by saying this:

Computational thinking is a set of universally applicable attitudes and skills that everyone, not just computer scientists, should learn and master.

In fact, computational thinking is akin to a skill or a how to from 21e century. The world of computing is often seen as an abstract and complex field. For example, discussions about artificial intelligence and journeys to Mars expose realities that are increasingly abstract and difficult to grasp. More and more problems require that humans use a machine in order to solve them. The computer thinking, it is therefore "a form of reasoning allowing to solve complex problems ”by analyzing a situation, dissecting it and tackling it sequentially. It is a way of approaching a problem step by step and of predicting the consequences of each action that will be taken.

Computer thinking is therefore not the prerogative of computer science and, on the contrary, it constitutes an asset in all school subjects and in all spheres of daily life.

Break down, structure and reformulate

Computational thinking contributes immensely to the development of problem solving skills. What is the task at hand? Is it difficult? If so, at what point precisely does it become complex? Evolving in a computer world promotes the ability to break down a problem, restructure its tasks and reformulate its objectives.

Computers can't think for themselves, at least not yet. So all the wonderful things they do come from precise, rigorously formulated human commands.

Self-assessment - self-regulation

Even the most recognized programmers agree with the following statement: If your code works on your first trial, something is wrong. (Free translation: If your code works the first time, something's wrong.) It's so rare for a program to work the first time that IT people are particularly skeptical when it happens. Many attribute this to the fact that programming languages require very high precision. Indeed, computer errors are rather obvious! In comparison, in a written production, forgetting a letter does not prevent the text from being read. On the other hand, in programming, forgetting a single symbol can very well mean that the program does not work at all. Testing is frequent and the self-regulating aspect is essential. Errors are not viewed negatively. On the contrary, they are considered as iterations in establishing an optimal solution. Learning to program takes time, patience, and even persistence.


 

Development environments and programming languages

When it comes to choosing a programming language for teaching purposes, there are several things to distinguish.

Programming languages vs development environments

Our programming language refers to the fcoding lesson: syntax and programming paradigm supported. As for him, thedevelopment environment refers to software framework in which a programming language will be used.

Pixabay

For example, the Visual Studio development environment allows programming in multiple languages such as C ++, Python, C#, Visual Basic, etc. On the other hand, we cannot say that we programmed something in Visual Studio, but we could say that we programmed something in Visual Studio using the C ++ language. In the same vein, we can say that we programmed something with Scratch, but in this case, we are referring to both the development environment and the programming language.

Educational languages vs "real" languages

Also, it is necessary to distinguish the languages created for a purely educational purpose from those which allow the creation of real applications that can be distributed. For example, Scratch, Blockly, and many other visual languages were developed specifically for learning the basics of programming. They are ideal for primary and early secondary students. On the other hand, the more the students develop skills in this area, the more they will want to use real applications requiring programming structures that these visual languages do not offer.

2 factors to consider when choosing a language

The syntax

The first thing to consider in choosing the programming language is syntax. Here are two code examples where we add all the numbers between 1 and 10 to assign the result to a variable x:

for i = 1 to 10

x = x + i

next i

for (i = 1; i <= 10; i ++) {

x + = i;

}

The code on the left is in BASIC language while that on the right is in C ++.

Without knowing the programming in these two languages, we can see that the code on the left has fewer syntactic elements than the one on the right and is a little closer to a natural language: "for i count from 1 to 10 and repeat: x is increased by i ”. Code written in visual languages like Scratch is much simpler. The transition to formal languages will be easier if we take into account this syntactic simplicity.

Development environment

The second thing to consider is the development environment. Being able to create an interface by moving objects on a window speeds up programming and allows for faster results, which is not negligible on the motivational level. There are several solutions on the market, some of which are free when used in an educational context. XOJO (www.xojo.com) is an interesting example. It offers a graphical environment and allows coding in an object oriented language derived from BASIC.

Whatever solution one chooses to teach programming in a formal way, it is advisable to minimize the time devoted to learning the syntax of the language and, consequently, to minimize the time that the students will have to devote to debugging for syntax errors. All this in order to devote as much time as possible to the programming logic that allows the development of computer thinking.


 

The little guide to educational robotics

There are dozens of tools for teaching programming in a robotic setting. Here are a few examples, presented in the context of the progression of learning.

Bee-bot and Blue-bot

Bee-bot is a robot that can move on a surface. To program it, just press arrows in the form of buttons. Blue-bot offers the same basic functions as Bee-bot, but it is programmable using an app available on iOS or Android.

Preschool and early elementary school children can use this tool to start learning sequential programming by having the robot follow paths on a play mat, or to find a path through obstacles. Sets containing activities and multiple robots are available. It is a nice tool to introduce computational thinking.

The retail price of a Bee-bot is about 140 $, while we will have to pay approximately 190 $ for the Blue-bot.

Cubelets

They are magnetic cubic blocks that can be put together to build a robotic structure. Each cube has a unique function, such as a light or distance detector, a motor, a speaker, a light, etc. When assembled, the structure can accomplish a task determined by the sum of the functions of the chosen blocks. It is not necessary to program them: the assembly dictates the behavior of the structure and thus resembles a robot. It is also possible to program the Cubelets using an app available on iOS or Android.

Preschool and elementary school children will be able to learn robotics principles, but also be exposed to some form of formal logic, since cubes allow for minimum or maximum inversions and operations. The latter are equivalent to the three basic operators in logic: the “and”, the “or” and the negation. Moreover, the Cubelets are adapted to this clientele and are robust.

We will have to invest about 400 $ for a set of 12 Cubelets, suitable for a team of two students. Other sets are available, up to nearly 6,000 $ for the teacher's kit and 162 Cubelets, with all the necessary accessories (chargers, cables and adapters Lego).

Pixabay

LEGO Mindstorms EV3

Lego Mindstorms EV3 is a set of programmable robotic elements offering a huge variety of possible designs. It requires the use of an Android or iOS tablet application or computer software (Mac or PC). The programming is very visual, in the form of blocks interconnected in sequence.

Lego had the brilliant idea of integrating robotics into its legendary blocks, which makes it possible to introduce children to computer thinking while developing their fine motor skills.

The minimum age recommended by Lego for this set is 10 years, either from the fourth or fifth year of primary school, especially because of the small parts. Mindstorms remains an attractive solution for several years thereafter, including at the start of high school. Many robotics competitions use Lego Mindstorms and are more and more popular in Quebec as elsewhere in the world. A basic set retails for approximately 430 $.

mBot

The company Makeblock offers several types of robots, some with the name mBot. The most interesting aspect of this Arduino-based robot is that it can be programmed using an enhanced version of Scratch, a programming language that can be taught as early as elementary school.

The mBot can move and follow a path on a surface. It also has a distance sensor and can make sounds and turn on colorful LED lights. The model mBot Ranger is quite suitable for high school students.

Another strength of this product is the price of this range of robots, around 130 $ for the most affordable model. This makes it an accessible robot for both schools and families.

Arduino

Although there are several variations, it is essentially an electronic microcontroller for analyzing or emitting electrical signals. It can be used to read information from sensors, control motors, etc. It must be programmed with the C ++ language, which, for the teacher, requires some basic programming knowledge.

It is used in several technical college programs, but also with high school students, particularly those in Secondary IV and V. It is a great tool for teaching programming in a formal way while introducing elements of electronics and robotics, especially considering its low cost of purchase, which is around 30 $ for a Arduino Uno. There are also educational kits offering many projects for a little over a hundred dollars.

Raspberry Pi

Our Raspberry Pi is a small computer running Linux, a free operating system. It occupies a very small volume and offers more computing power than a Arduino. This makes it possible in particular to control many components or devices at the same time.

Our Raspberry Pi offers all the basic functions of a computer: word processor, spreadsheet, drawing software, browser, etc. It is also possible to program with the Python language.

The possibilities offered are impressive, especially considering its price: it ranges from 60 $ to a little over a hundred dollars for a kit containing everything you need to get started with the Raspberry Pi 3.


 

Acknowledgments and references

We would like to thank Brault & Bouthillier who allowed us to test some of the products mentioned in this dossier.

The mBot, Arduino Uno and Raspberry Pi products were purchased from Abra Electronics in Montreal.

References

A National Talent Strategy: Ideas for Securing US Competitiveness and Economic Growth : http://www.microsoft.com/en-us/news/download/presskits/citizenship/MSNTS.pdf

Activity debugging : Brennan K., Balch C., Chung M. Creative computing. Harvard Graduate School of Education, Creative Commons. In line : https://files.inria.fr/mecsci/CreativeComputingFr/CreativeComputing20140806_FR_ttfrancais.pdf

Jeannette Wing: Wing J., “Computational Thinking”, Communications of the ACM, March 2006, vol. 49, no 3.

Computer Thinking: Girard, M.-A. (2016). [Interview with Alexandre Lepage] Computational thinking: accessible to everyone. Online : www.ecolebranchee.com/2016/12/07/pensee-informatique-accessible/

 

École branchée broadcasts texts from actors in the educational community. You can contribute too! Take the opportunity to share your ideas, talk about an educational project experienced in class, etc. Find the details in the menu About / Submit an article.