THE BIG BOOK OF COMPUTING PEOAGOGY

Page 14

FEATURE

THE CODE’S NOT ALL RIGHT How do you decide when to teach a concept the right way, and when to simplify it? t’s a pretty common classroom task — you have some data of various types, and you want to teach students how to print the data out as part of a sentence, using Python. Here’s my example data:

I

number = 1 person = “Scott” The exam board wants students to know how to concatenate, so you might choose to teach the + operator, although it’s a bit of a pain that the students will also have to put the spaces in the right place and remember to cast the integer to a string: print(“Thunderbird ” + str(number) + “ is piloted by ” + person) Alternatively, you might teach your students to separate the different parts with commas to avoid the casting issue. You either don’t realise, or choose to disregard, that this isn’t actually concatenation: it’s taking advantage of the way Python’s pri nt() function works:

Building a mental model

When teaching beginners, there is a conflict to resolve: should you teach the way a more experienced programmer might approach a task, or teach the learner to use a suboptimal method, which either produces quick results or allows them to better access and build a mental model of what the program is doing? When I was a teacher, I frequently shared resources online, to help others and save my fellow teachers valuable time. Occasionally I would receive feedback on my resources from IT professionals — some was extremely helpful, and some was less so. The helpful feedback felt collaborative and helped improve the outcome for children. These professionals helped me to improve my subject knowledge by providing a friendly suggestion of an alternative way

to approach a problem, where I hadn’t realised that a different approach existed. This was extremely welcome, and I am indebted to people such as David Whale, Martin O’Hanlon, and Andy Stanford-Clark for their generous mentoring. I would also sometimes receive feedback on my resources from IT professionals which highlighted occasions when I had deliberately made a decision to teach a concept in a suboptimal way, for a pedagogical reason. These developers pointed out so-called flaws and suggested what they thought were better ways of doing things, but they often forgot that, just because they are good at programming, that doesn’t necessarily mean that they are good at teaching programming. I’ve encountered developers who expect eight‑year-olds to have mastery of concepts that are not introduced until A

print(“Thunderbird”, number, “is piloted by”, person) You could also choose to avoid the casting issue in a different way by teaching format(), but will this confuse the students?

There are probably multiple other ways to achieve the same goal, each with their own benefits and drawbacks. Some people will argue vehemently for one or another (there’s a long-running debate about format() within the Raspberry Pi Education Team!), but which one is right?

14

The Big Book of Computing Pedagogy

nW hat thought processes do learners go through to create a simple game?

Credit: Monkey Business/stock.adobe.com

print(“Thunderbird {} is piloted by {}”.format(number, person))


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
THE BIG BOOK OF COMPUTING PEOAGOGY by black century - Issuu