2019-02-04_teaching-kids-to-program.md 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. Title: Teaching kids to program
  2. Date: 2019-02-04 00:00
  3. Category: News
  4. Slug: teaching-kids-to-program
  5. Lang: en
  6. ![Screenshot][screenshot]
  7. In this article, Michael shares his experience of teaching kids to program.
  8. Here's what he covers:
  9. - organization of the learning process
  10. - learning plan
  11. - memory game
  12. - development tools
  13. - lessons
  14. - results and plans
  15. **Organization of the learning process**
  16. The learning process is conducted as part of corporate social responsibility: a company provides a room with equipment and connects employees that want to try themselves in the role of teachers with employees that want their kids educated. All this is done voluntarily.
  17. Potential teachers are divided into groups so that each group contains three teachers: experienced one and two novice ones. Such a group of three teachers leads a group of students. Students are divided into groups by age and skills.
  18. I participated in the program as a teacher for the second time in 2018. The kids were around ten years old. Our group was active from October to December of 2018 each Saturday, 10:00-12:00. Using my position as a teacher, I've also brought my wife in as a student.
  19. **Learning plan**
  20. The first time I participated in the program, our group taught kids rather mindlessly: we were coming up with simple tasks to explain different operators. By the end of the course we had nothing concrete to evaluate, analyze, and share.
  21. This second time I decided we are going to create a memory game with kids. I decided to consider the course successful if by the end of the course each kid would be able to create a simple memory game from scratch in an hour.
  22. To achieve that, we were recreating the same game from scratch each lesson. I'd like to stress that we did not use personal accounts to save progress. Our task was to save the skill of game creation in the head, not a PC.
  23. **Memory game**
  24. Let's see what the memory game is.
  25. **1)** In the simplest case we have 16 cards, only 8 of them are unique, the rest 8 are duplicates of the unique ones.
  26. ![Screenshot][all-cards-face-up]
  27. As you can see, we only have two cards with a cat, only two cards with a dog, etc..
  28. **2)** At the start we shuffle the cards and place them with their faces down.
  29. ![Screenshot][all-cards-face-down]
  30. **3)** The first game player turns a pair of cards.
  31. ![Screenshot][first-pair]
  32. **4)** If the cards differ they are once again turned face down.
  33. ![Screenshot][all-cards-face-down]
  34. **5)** The next player turns another pair of cards.
  35. ![Screenshot][second-pair]
  36. **6)** If the cards are the same, they are removed from the field.
  37. ![Screenshot][remove-pair]
  38. The goal of the game is to remove all cards from the field. There's no competition here so the game can be played alone.
  39. From one hand, the memory game is rather simple. From the other hand, the game implementation requires essential functionality each more or less complex game has:
  40. - creation of items
  41. - arrangement of items
  42. - selection of items
  43. - comparison of items
  44. - removal of matching items
  45. **Development tools**
  46. We used Scratch as our development tool. [Scratch][scratch] is a great tool to teach kids to program because each action, each operation is represented graphically.
  47. For example, you can rotate a cat 360 degrees in 1 second using the following script:
  48. ![Screenshot][cat-script]
  49. Here's how it looks like in action:
  50. ![Animation][cat-animation]
  51. I'd like to stress that Scratch is a rather successful solution to represent code graphically. For example, a paid solution by SAP uses similar concept of cubes to program logic:
  52. ![Screenshot][sap-ui]
  53. Users can only input values into predefined fields. If users want more functionality they have to resort to scripts.
  54. Personally, I have never witnessed any slowdown in Scratch, and there were many in SAP's solution.
  55. **The first lesson**
  56. The first lesson was introductory, we didn't use PCs.
  57. The plan was to:
  58. 1. Meet
  59. 2. Play the memory game with cards
  60. 3. Learn the concept of algorithm
  61. 4. Detail the game's algorithm
  62. 5. Analyze the lesson
  63. **1)** Meeting
  64. Both teachers and students stand in a circle. This equalizes everyone and makes everyone a team member.
  65. The first team member tells his name and why he decided to take the course. The second team member and the rest first repeat the name and the story of each previous team member before telling their own names and stories.
  66. Here's how it looks like:
  67. 1. John: "My name is John, I am going to study Scratch because my father forces me to"
  68. 2. Alex: "This is John, he's doing Scratch because his father wants him to do it. My name is Alex, and this is my fourth year with Scratch"
  69. 3. Ann: "That's John, his parents force him to do Scratch. This is Alex, he's a Scratch veteran. And I'm Ann, a novice teacher, so I'm going to learn together with you all"
  70. Such a format of meeting has the following objectives:
  71. - Getting to know each other
  72. - Each team member should know other team members by name
  73. - Common space
  74. - Everyone is in the circle, not at a working desk, this prevents distraction of kids by PC games
  75. - Equality
  76. - Both teachers and students are in the same circle, this equalizes everyone as a team member without hierarchy
  77. - Attention
  78. - Each team member should listen carefully to be able to correctly repeat what others said
  79. - Feedback
  80. - Each team member should be as clear as possible when expressing thoughts, otherwise nobody would be able to repeat them
  81. - Fun
  82. - Memorization problems produce lots of laughter
  83. **2)** Memory game with cards
  84. 1. Take 8 pairs of the same cards from two decks of cards
  85. 2. Place the cards in 4 x 4 grid, faces down
  86. 3. Students stand up around single table
  87. 4. Each student, one by one, turns a pair of cards
  88. - If cards match, they are taken off the field
  89. - If cards differ, they are once again turned face down
  90. Students are eager to play tabletop games. During the game party teachers say out loud each step in the game's algorithm.
  91. After a couple of parties it's time to find out what algorithm is.
  92. **3)** The concept of algorithm
  93. 1. Ask students first, hear them out to find out their level
  94. 2. Correct what students say if they were close to an expected answer
  95. 3. Ask students to write an algorithm to move a man from "stands outside a room" state into "sits and works at a PC" one
  96. Students like to go to blackboard and write, so we ask each student to come and write a single step of the algorithm at a time. The most active student should execute the algorithm by following it strictly.
  97. **4)** The algorithm of the game
  98. Ask students to compose the game's algorithm. Again, let students come to the blackboard and add one step of the algorithm at a time. Once the algorithm is ready, play the game with cards once again. Now, each student should say the algorithm's step he executes.
  99. Here's how it looks like:
  100. 1. John: "Place 16 cards faces down"
  101. 2. Alex: "Turn a pair of cards"
  102. 3. Paul: "If the cards differ, turn them faces down again"
  103. 4. Dan: "Turn another pair of cards"
  104. 5. Mike: "If the cards match, take them off the field"
  105. **5)** Analyze the lesson
  106. That's it for the first lesson. Teachers finally have time to discuss the lesson: discuss the kids, approaches to shy and active kids, plan next lessons.
  107. We had the following decisions:
  108. 1. Arrange students so that active ones sit next to shy ones as "active-shy-active-shy-etc" so that we don't end up with two groups of shy and active students at different sides of a room, which would hamper productivity.
  109. 2. Only accept accurate answers from students because active students like to wriggle, which hampers discipline.
  110. **The second and the third lessons**
  111. We were beginning each lesson with the same meeting: we would stand up in a circle, tell our names and what we did. Those who did nothing should have said why. Just as before, everyone should first repeat what previous team members said.
  112. We spent the second lesson to create requirements for an item of the playfield and then create the item in Scratch. This was moderately successful.
  113. We spent the third lesson trying to create 16 items and arrange them in 4x4 grid. We failed miserably because we could not explain coordinate system to students. It became apparent that lesson plans were only plans, reality had its own demands.
  114. We saw two ways to approach the problem:
  115. 1. Keep on studying the coordinate system risking not to get the game done by the end of the course
  116. 2. Change the game requirements so that coordinate system is not necessary
  117. We went the second way because, after all, we're not a school, our goal was to teach kids to create the game, i.e., use skills in practice, not theory. That's why we replaced 4x4 grid with a circle of 16 items.
  118. This solution sparkled a few thoughts in my head:
  119. 1. One can often find a simpler path to solve an issue
  120. 2. This path is simpler to understand, albeit less flexible
  121. 3. One can go the harder path to increase flexibility much later when it becomes absolutely necessary
  122. 4. Simplification moves one closer to the goal, complexification moves one in the opposite direction
  123. **The fourth and the rest of the lessons**
  124. The fourth lesson marked the end of coming up with requirements in class because doing so started to take too much time. We chose practice over theory once again to meet the deadline. This time all requirements were conducted before the lesson. Still, nobody read them.
  125. We spent the fourth and the fifth lessons to create 16 items in circle, select a pair of items and match them.
  126. We started recreating complete game from scratch on the sixth lesson. Each time students were recreating complete game faster and faster. On the eighth lesson we introduced a leaderboard to track how fast each student recreates a specific part of the game.
  127. **The last lesson**
  128. When the last lesson approached everyone was able to create the memory game from scratch more or less independently in two hours.
  129. Here's the leaderboard of the last lesson (names are hidden):
  130. ![Screenshot][leaderboard]
  131. The leaderboard is in Russian, here are the captions translated:
  132. - Name
  133. - Circle of items
  134. - Selection of pairs
  135. - Hide all
  136. - Hide a pair
  137. Here you can witness the creation of the memory game from scratch by the fastest student: in just half an hour.
  138. <iframe width="560" height="315" src="https://www.youtube.com/embed/WlA193S3SPY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  139. <br/>
  140. **Results and plans**
  141. The results surpassed my expectations:
  142. - three students made it in an hour or faster
  143. - two students made it in an hour and a half or faster
  144. This year I plan on doing another round of the memory game recreation. However, I'm going to replace Scratch with Opensource Game Studio tools: the students will use Lua, Git, and GitHub Pages.
  145. That's it for sharing Michael's experience of teaching kids to program.
  146. [screenshot]: {attach}/images/2019-02-04_teaching-kids-to-program-team.png
  147. [all-cards-face-up]: {attach}/images/2019-02-04_teaching-kids-to-program-all-cards-face-up.png
  148. [all-cards-face-down]: {attach}/images/2019-02-04_teaching-kids-to-program-all-cards-face-down.png
  149. [first-pair]: {attach}/images/2019-02-04_teaching-kids-to-program-first-pair.png
  150. [second-pair]: {attach}/images/2019-02-04_teaching-kids-to-program-second-pair.png
  151. [remove-pair]: {attach}/images/2019-02-04_teaching-kids-to-program-remove-pair.png
  152. [scratch]: https://scratch.mit.edu/
  153. [cat-script]: {attach}/images/2019-02-04_teaching-kids-to-program-cat-script.png
  154. [cat-animation]: {attach}/images/2019-02-04_teaching-kids-to-program-cat-animation.gif
  155. [sap-ui]: {attach}/images/2019-02-04_teaching-kids-to-program-sap-ui.png
  156. [leaderboard]: {attach}/images/2019-02-04_teaching-kids-to-program-leaderboard.png