Today I went to a food bank

Today is my last day of maternity leave, and I am really looking forward to being back at work. I have joked on Twitter about spending a large proportion of my maternity leave in supermarkets, but it is in fact not really such a joke.

As sad as it may sound, supermarkets have been pretty good mat leave entertainment – free to walk around, lots to look at for a baby and you usually end up picking up a few bits and bobs you need as you walk around. Or at least it certainly appears that casually buying groceries is an activity open to middle class ladies on maternity leave. The more I went to supermarkets and “picked up bits and bobs”, the more I started to think, and some of these thoughts were uncomfortable. Every time I bought a few groceries on a jolly with my son, it reminded me that some families couldn’t even afford basic food and necessities. I have found maternity leave pretty hard going as it is due to a few injuries (which are now fixed, cheers NHS!), but I can’t comprehend what life must be like if you have to worry about where your next meal is coming from.

Another thing I’ve done a lot of on maternity leave is loiter around on Twitter. I noticed a few times people I followed had retweeted @BootstrapCook talking about food banks:

Food banks are not really something I had paid much attention to before, but reading these tweets really caused my thoughts to coalesce, so I decided to spend some time on my last day of maternity leave buying some food and donating it to a food bank. Off I popped this morning to Asda expecting to buy some tins of beans and packets of biscuits, but I certainly did not expect the feelings that accompanied the food. I had a budget in my head, and a self-scanning machine in my hand. I began scanning Smartprice tomatoes and I had about 8 tins in the trolley before I realised my shop so far had come to approximately £2. That was not even the price of a latte – so many of which I have consumed on maternity leave I have lost count. I felt overwhelmingly sad that in 2018 people probably just down the road from me are having such a hard time that they are relying on food banks for survival while I’m sitting in Waitrose having a latte.

My boot completely full of food

In the end I managed to fill up my ENTIRE BOOT with food for the budget I had in mind. I chose to buy Smartprice food for the most part because I wanted to get as much as possible.

You might say “why are you writing a blog about this, you just want praise/you just feel bad and want to make yourself feel better”. I think it’s almost impossible to do something completely selfless – I did get pleasure from going shopping for this food in the knowledge I would be helping someone. However there is nothing whatsoever “feel good” about handing in food to a food bank. It’s the harsh coal face of life, handing in your bags of donations to be weighed whilst in the next room people are waiting to receive their supplies to sustain themselves for the next 3 days. Why am I in this room and they are in that room? Luck.

Food sorted and waiting to go at the food bank

So really the point of writing this blog (and sorry, because it has nothing to do with my usual blogging topics) is largely to bring this to a tiny corner of your attention, just like Jack Monroe’s tweets wormed their way into a corner of mine. I challenge you to set yourself a budget you can afford and then go to the supermarket and pick up some food to donate. Look on the internet to find your local food bank and it will tell you which items they are in need of and which they have lots of in stock. This is a good list if you want some other suggestions, or you could donate money if you are short on time.

Bonjour, tout le monde!

Did I ever tell you about the time I taught Year 7 French? The Head called me into his office one summer and basically said that they didn’t have enough to fill my timetable and could I please teach a class of Year 7 French as there was no one else to do it. He added that he knew I’d got a GCSE in it, been to Paris on holiday and had noticed I usually had a baguette for lunch, so I would probably pick it up quite quickly. “Bonnet de douche!” I thought – having to teach a bit of French is better than getting made redundant, so I agreed.

I bought a text book and some online materials. Everybody I spoke to said not to worry as there was loads of stuff available online for learning French, and the kids would probably pick it up from watching Youtube videos in their spare time. The first lesson arrived and I was feeling pretty nervous, but we learnt how to say “Bonjour, tout le monde” and some basic vocabulary and ‘voila’ it seemed to be pretty straightforward! I was feeling good, the vocab was flowing and I was able to keep just ahead of the kids by looking at the next page of the text book when I did my planning.

Then after a while things got a bit difficult. There were tenses to learn and the kids had to get the right tense along with the right form of the verb, as well as knowing the vocabulary. To be honest, I didn’t feel very ‘creme de la menthe’ about whether what they had written was right or not, but I had to keep ploughing on. There was one kid in the class whose mum was French, so that kid basically acted as a second teacher, showing the other kids what to do and fielding the tricky questions I wasn’t sure about. I tried really hard to learn more French at home during the evenings but to be honest I was completely exhausted from the day’s work already and it was so hard to learn a new thing with no head space or training for myself.

The weeks passed and we muddled through. A couple of people laughed at me because I asked what they thought was a stupid question in an online forum for French teachers. ‘Pas de Calais’ I thought, I won’t bother asking for help again. I learnt a lot alongside the kids but it was hard work. Eventually the end of the year came around and the Head called me into his office again. ‘Mon dieu!’ I thought, it’s the guillotine for me! However, he actually said what a good job I’d done, made me Head of French and asked if I could teach GCSE and A-Level next year.

And if you think this story is ridiculous, replace French with Computer Science and shed a little tear for the teachers for whom this is a true story.

 

Women and wearables

Last week I found out I was included on a list entitled “Top 100 Women in Wearable and Consumer Tech“, collated by Women of Wearables (@Women_Wearables on Twitter). I first met Marija from WoW at the BETT show last year and she contacted me to have a chat and do an interview shortly after. I had spent a large proportion of BETT showing people how to make LED robot badges and I had also just been working on two wearable resources for kids, for the Raspberry Pi Foundation – here they are if you want to try them out!

Last summer I was lucky enough to be able to attend Constructing Modern Knowledge in Manchester, NH (USA) which is unlike any other event I’ve ever been to. They have an absolute treasure trove of fabulous kit, knowledgeable facilitators and keen and enthusiastic participants. Mix those together and you end up with teams of educators collaborating to create…whatever their imagination permits! Here’s my wearable make from CMK, a colour sensing glove:

If you’re ever lucky enough to get the opportunity to attend CMK, go for it! You’ll also get to meet Gary and Sylvia, authors of Invent to Learn who are super friendly and run the event with (a very American level of) passion! 🙂 I had a fantastic time.

This is just one side of one room containing the kit available at CMK

This is just one side of one room containing the kit available at CMK

Anyway,  I am super happy to finally be “on a list” – I see lists of “Women in Tech” all the time, and I always wonder what it takes to be included. There is my name next to some pretty awesome women, but I can’t help but feel that I must have just have been in the right place at the right time. My style is more hacking together tutorials for kids with a bit of dodgy sewing than, I dunno, Senior VP at Apple Retail(!) – #5 on the list!  So, I wanted to share some work from other women who have done equally cool and hacky things with wearables at the maker end this year, in the hope that maybe next time their names will be on a list somewhere too! 🙂

First up, Rachel (@konichiwakitty) who I have been avidly following on Twitter. I particularly love that she runs wearable workshops at various events, and don’t miss her fabulous LED headbands – especially the one with donuts that was featured on the Adafruit website!

Secondly, Lorraine (@LMcUnderwood) who has a whole array of makes and tutorials for wearables and other cool physical computing stuff. I particularly like her sound sensing hoodie – check it out! She manages to make my nemesis (powering large quantities of LEDs from a microcontroller) look like a breeze.

Thirdly, Tanya (@tanurai) who made a fabulous LED dress for her works do, and whose feed is constantly filled with inspirational quick makes and fun things she’s put together. She’s also interested in making digital making accessible to as many people as possible, which is a huge plus in my book.

Of course, there are probably tons more cool projects I’ve missed and women who have created awesome wearables over the past year. If you’ve created something you’re proud of or you’ve spotted some maker wearable coolness, leave a comment below. Let’s celebrate the digital making end of women and wearables!

Writing programming workshop resources

I write a lot of educational resources, so I thought it might be useful to share some tips for things I’ve learnt over the years. I’m hoping that these tips will be particularly helpful for those people in the wider community who volunteer to give up a lot of their time to run workshops for kids but who don’t necessarily have formal training in education.

Avoid a wall of text – Before you start writing anything at all, think about how old the learners are. If you’re working with very young children (5 – 7 years old) you will need to keep the written instructions to a minimum and use lots of pictures and screenshots. As the children get older they can cope with more verbose instructions…up to a point. Children don’t read instructions, and it’s not because they are naughty, easily distracted or can’t cope with the task. (Most adults don’t read instructions properly either!) Use pictures and diagrams as much as you can in place of lengthy explanations.

Check the level – The most common mistake I see in resources not written by teachers is vastly overestimating the level a child will be able to cope with. I’ve seen people assume that 8 year olds can cope with things that are introduced at A-Level. I’ve also seen people saying the equivalent of “the 7 year olds in my programming club wrote a recursive fibonacci sequence function last week”. No they didn’t. *You* wrote a recursive fibonacci sequence function last week and they copied out your code. If you’re not sure what level is appropriate, ask someone! There are plenty of experienced educators on twitter who could field your question. (Of course there will always be individual children whose capabilities far exceed their peers, but suitable tasks for a workshop should be designed with the average attendee in mind.)

Don’t make them type the hard stuff – If the thing you want to create requires a little bit of difficult code that is beyond your learner, that’s fine. Don’t make them copy out unintelligible (to them) code and say “don’t worry about what this does” though, give them a starter file with your code inside it. You could also consider using a site like trinket.io where you can add your code in a separate tab and let them get on with their bit.

Give clear instructions – When you ask the learner to perform a task, make the instruction for what they have to do explicit and clear. “You’ll need a forever block”/“You can use a forever block” is not as clear to a child as the direct instruction “Add a forever block”.

Explain where to add code – One of the most common sources of confusion for learners is being asked to add some code to their program but not knowing where to add it. Be very clear about where new code should go (“add this code as the first line of the blah() function”), or use a screenshot with line numbers or an arrow, for example:

Add the code to import the random library here:

 

 

 

 

Allow play and experimentation – The end goal of a tutorial or workshop is not to recreate the exact program you envisaged when coming up with the workshop. The end goal is that the learner learns something and has fun doing it! Try to plan for this in your task by allowing them to personalise the task (“Add your own page title between the <title> and </title> tags”/ “Choose a sprite to represent your player”). Does it really matter if their maze game character is a floating piece of cheese rather than Pacman?

Explain why – If you’re asking the learner to copy out some code, explain why. Compare the following approaches:

Add this code:

 

This line of code will open the file a_file.txt in read mode (r) so that you can see what’s inside it. Add the code at the end of your program.

 

 

Not too much too fast – I’ve seen resources for kids that start off by explaining variables, selection, two kinds of loops and functions within the first two paragraphs, and then expect them to be used fluently throughout the rest of the tutorial. It’s not going to happen. Don’t assume that because you explained something once it was understood.

One does not simply – Avoid using phrases which trivialise the instruction (“Simply add a function to invert the wobblybobble”/“It’s easy to add some code to jiggle the flimflam”). It might be easy or simple for you, but for the learner it might seem extremely tough, and there’s no reason to make them feel bad unnecessarily.

Choose your words wisely – The Wikipedia definition of a variable is “A storage location paired with an associated symbolic name (an identifier), which contains some known or unknown quantity of information referred to as a value.” I’ve seen definitions along those lines in resources intended for kids. You need to simplify a concept as appropriate for the age group, for example you might say “You can store data inside a variable, and each variable has a name”. Also think carefully about throwaway words you use – it’s unlikely that most kids will understand words like API, native, REPL, mutable etc. or be able to infer their meaning from context.

Think about their background – Younger kids type reeeeeally slooowly. Think about how much typing there is for them to do, and how frustrating it might be. Can you reduce unnecessary typing by providing some starter code? If you’re using concepts from maths or other areas, think about when these are introduced in school. For example, kids start learning about coordinates in Year 5 (age 9-ish) so younger children might not cope if your workshop assumes they know what a coordinate is.

Remove the stabilisers – Once your learner reaches the end of your tutorial, is there an open ended task for them to do to build on what they’ve done so far? If there is, it will reap dividends for you as it keeps the learner gainfully occupied whilst you help slower workers, lets them have fun experimenting and will be the acid test of whether they understood what they just did or just copied out your code!

Leave a comment with your own top tips! 🙂

gui zero – making Python GUIs really simple

The code in this post has been updated to reflect the changes in guizero version 0.4.

When I was a teacher, I found it frustrating that it was not at all easy for students to create GUIs using Python. I used tkinter a little bit with my GCSE class and they instantly loved creating GUIs, but became frustrated because simple things were so difficult to do. After talking with some developers about this at Pycon UK, I decided to do something about it, and so I wrote a library called guizero which is meant to be used by children and removes all the unnecessary nasty bits without removing the intellectual requirements. Another thing which is important to me is that guizero is very easy to install and get started with – so there’s a completely no faff installation process, which is a winner if you’re struggling with getting your school techies to install things.

Download guizero and read the documentation here

But, promo flannel aside – is it any good for use in the classroom? On the CAS resources site, Stuart Lucas posted a popular “Book of programming challenges” resource (9651 downloads at the time of writing) so I thought I’d put guizero to the test to see how easy it is to complete a few of his challenges with a GUI and let you see for yourself.

Challenge 1

Write a program that will display a joke. Don’t display the punchline until the reader hits the enter key.
Extension: display the punchline in a different colour.

from guizero import App, Text, PushButton

# Method to call when button pressed
def display_joke():
   punchline.value = "Poke him on"
   
# Set up the app
app = App("Joke teller")

joke = Text(app, "How do you get Pikachu on a bus?")
punchline = Text(app, text="", color="red")
button = PushButton(app, display_joke, text="Display punchline")

app.display()

challenge1

So this was pretty straightforward. I created two pieces of text and a button, with the second piece of text remaining blank until the button is pressed, at which point it fills in the punchline.

Challenge 2

Write a program that will ask you your name. It will then display ‘Hello Name’ where ‘Name’ is the name you have entered.

from guizero import App, Text, TextBox, PushButton

# Method to display the greeting
def display_greeting():
   text.value = "Hello " + name.value

# Set up the app
app = App("Hello machine")

text = Text(app, text="What is your name?")
name = TextBox(app)
button = PushButton(app, display_greeting, text="Greet me")

app.display()

challenge2a challenge2b

This challenge makes use of the get() and set() methods of the Text and TextBox widgets to easily get values typed in and display them elsewhere on the page.

Challenge 3

Write a program to work out the area of a rectangle. Collect the width and height of the rectangle from the keyboard. Calculate the area and display the result.

Extension: Display the volume of a cuboid. See what happens when you don’t type in numbers! Try to explain what has happened and why.

from guizero import App, Text, TextBox, PushButton, error

# Method to calculate the area
def calculate():

    # Validation to check whether they typed in numbers
    if not height.value.isdigit() or not width.value.isdigit():
        error("Input error", "You must type in numbers for height and width")
    # Depth is allowed to be a digit or blank
    elif not depth.value.isdigit() and depth.value != "":
        error("Input error", "You must type in a number for depth")

    # Perform the calculation
    else:
        area = int( height.value ) * int( width.value )
        if depth.value == "":        
            result.value = str(area) + "cm squared"
        else:
            volume = area * int(depth.value)
            result.value = str(volume) + "cm cubed"
        

# Set up the app
app = App("Area and Volume calculator", layout="grid")

width_label = Text(app, text="Width:", grid=[0,0], align="left")
width = TextBox(app, grid=[1,0], align="left", width=30)

height_label = Text(app, text="Height:", grid=[0,1], align="left")
height = TextBox(app, grid=[1,1], align="left", width=30)

depth_label = Text(app, text="Depth:", grid=[0,2], align="left")
depth = TextBox(app, grid=[1,2], align="left", width=30)

button = PushButton(app, calculate, text="Calculate", grid=[1,3])

result_label = Text(app, text="Result:", grid=[0,4], align="left")
result = TextBox(app, grid=[1,4], align="left", width=30)

app.display()

challenge3a challenge3b challenge3c

This challenge was a little tricker. I used a grid layout so make the interface look tidy and line up the boxes properly. However, it wasn’t the GUI part which generated most of the code here, it was the validation. Since the get() methods always return strings I had to cast them to integers to do calculations (but this should already be familiar to students). I also saw a good excuse to use the error() box function to pop up a message if the validation check didn’t pass.

What do you think?

I’d love to hear your thoughts on guizero – whether they are positive or negative. Is this useful for you and your students? Is there something you’d like it to do but it doesn’t currently do? Would you like to see a tutorial on how to do a particular thing? Is there a bug? You can find the project on GitHub and add issues/ideas here, or leave a comment on this post, or tweet me @codeboom with your thoughts.

Exciting adventures at Pycon UK

Having missed out on the previous n years and had to endure extreme jealousy caused by the exciting tweets, I decided that this was going to be the year I finally went to Pycon. I had heard that there was an education track and that this was the way to meet real live developers! I have never been to a conference before, so all expectations I had for what would happen were entirely based on my attendance at *cough* Anime conventions long long ago. Sadly there was no one dressed up as a Python and a distinct lack of people speaking questionable Japanese, but the following awesome things did happen:

– Everyone was super friendly! Without exception, everyone I spoke to was really positive, warm and welcoming:  the people who helped me in the slack, the organisers in every aspect, especially setting up the AV stuff for my talk, the hilarious waiter at the conference dinner and the people who said hi to me because they’d met me in a previous session.

– There were loads of women! I didn’t realise there was a Django Girls stall on Friday otherwise I would have gone to say hello to them, but in general just looking around there were far more women than I expected to see, which made me forget all about whether it would be weird to be female at a tech conference. Just like in real life™ it wasn’t, no one cared. Bov. Good.

– I got in a queue which I thought was for coffee, only to find out it was to be given a FREE MICROBIT. Seriously this is the best thing to find out when you get to the end of an enormous queue. And, double bonus, there was coffee as well somewhere else!

– Real developers wanted to help ME. Well, US – teachers of the UK, there is goodwill out there. There are lovely people who don’t laugh when you tell them you can’t get on with Tkinter and instead ask how they can make using GUIs better. They didn’t have to do that, they could have been in one of the many other talks which were probably more relevant to their own interests, but instead they chose to spend their valuable time coming to see how they could make education better. Thank you.

– There was free water, and lots of it. This was great, thank you. If I’m allowed one moan, it would be that it would have been nice to have some water available during my talk because by the end my throat felt like I’d just played chubby bunnies with a packet of Ryvita.

– There were loads of loos. I know this is really silly but queueing for ages for the loo at an event is really annoying. Plus, if you give out lots of free water then needing loos is a logical consequence. I’m going to stop talking about loos.

Carrie Anne talking about farts to parents. I’m not joking, capturing parents of kids on the kids track and bundling them off for a talk about digital making, that’s pure genius. Well played.

– My talk! I loved giving a talk, and people actually came to it and listened to it and tweeted about it. YAY. If you’re considering doing a talk, but don’t know if you should do a talk, you should do a talk. Totally.

So, I would highly recommend to teachers that next year you look up PyconUK and try to go on the teachers’ day (this year it was Friday) – they even offer you a bursary of £200 towards supply cover so there is really no excuse for school not to let you out.

I can’t believe I’ve got through a whole post without a rant. OK here’s a rant… I WAS A SPEAKER AND MY BADGE WASN’T BLUE. GAHHH. STUPID PYCON.
(Regular readers will know that this is of course a joke – most of my other blog posts are highly opinionated!)

Oh, and no one laughed at my Overwatch joke. *shakes fist*

 

Cat Cat Code Ltd

So here it is! I’m taking the plunge as of September and starting my own business – Cat Cat Code Ltd.

I’ve put up a blog post with some tips on teaching HTML and CSS on the site so please do pop over and have a look. If you know of someone who could benefit from some Computer Science expertise then I’d be extremely grateful if you would send them my way. I’m also not currently booked for BETT so I’m available for work there.

PS Fear not, this blog is not going to descend into a relentless spam of advertising, I just thought I’d give you a heads up and now it’s back to business as usual!