Teaching functions


One of the best ways I could think of to teach functions to students was using the idea of parents daily chores. Instead of mom saying Johny have you done your homework, brushed your teeth and and put on pjs. Johny knows every night he will be using the same “function” nightly so instead of mom saying blah blah blah lol she can replace numerous steps with Johny night time function :slight_smile:


Comparing coding to basic steps to be done during any problem. I agree with Eric


I think explaining that functions can save steps instead of rewriting the code every time you need it is something students can understand and appreciate. Do your students like shortcuts? I know mine do.


K-5 Art Teacher teaching functions:
When using watercolor paints, you have to do the same repetitive steps to get the paint on the paper - dip the brush in the water, dip the wet brush into the paint, paint the paper. If we were coding this we could call it watercolor painting. This is a very simple example since we could only use one color of paint at this point in our learning!


In the elementary setting, I would provide a list of directives in order. I might even point out our morning routine vs afternoon routine upon entering the classroom. Each set of directives has a title but is part of the entire day.

Morning Routine
Afternoon Routine
End of Day Routine


In the 4th grade class we have procedures. For example, getting to the bathroom we must share with 9 other classes. The steps needed to carry this out at the beginning of the year are repeated separately each time our time for bathroom occurs in the overall schedule for all classes on our elementary hall. Eventually, the sequence of steps comes down to one “name/function”-“bathroom procedure”. This then sets in motion the series of steps needed to get the entire class to the bathroom on the schedule for all of the classes.


Similarly to other suggestions, I like the idea of relating it back to the class “morning routine”. We call it a “morning routine” but it involves multiple steps, we just call it by its name as a “short-cut”. My students would understand and relate to the idea of a Function as a “short-cut”.
Additionally I think they would find it useful to link to song lyrics, and the use of the “functions” of Verse and Chorus instead of re-writing the chorus each time it is sung.


I would explain this as creating a set of instructions under a new name, which you can then replay several times.


We go on a field trip to a lake every year, and one of the “take home” ideas they send back with us is a key chain craft very much like the beading craft suggested. I think I can connect these 2 activities together in a way that supports both coding learning and water conservation learning.


If my students are familiar with Karate Kid (movie), I want to try the Miyagi method - i.e., wax on, wax off, etc. As Mr. Miyagi had Daniel repeat all those crazy moves (wax on wax off, sand floor, paint fence, etc.), I will define different karate skills and call them in the main program. Everyone will be making karate moves by using different skill sets of karate moves defined by the Miyagi method.


In science we use functions all the time.


To teach functions in kindergarten I would go back to the discussion about our steps to getting to class. Instead of listing every step separately I would have them group them according to the task and then name the task. The first task (function) would be called getting ready for school. This would include getting out of bed, getting dressed, brushing their teeth, and eating breakfast. The next function would be getting to school, here they could either have their function be riding the bus, walking, or getting a ride.


We use the word function in science to describe the job something performs.


In my math classes they already know about math functions. But these are good methods to help those who may struggle with the concept mathematically.


I like the suncatcher example from the unplugged lesson and would probably use that. I would also explain that writing functions saves you time because you only have to write that set of directions once, then you just refer back to it.


I would really like to teach the functions lesson by creating suncatchers, since we do a science lesson on light and reflection. Not only is this a fun way to learn about functions, but the students have a cool creation/artwork/toy to take home. The only downside would be having funds to purchase the materials. I also like the song idea (I love music too) and talking about how efficient it is to write “chorus,” as opposed to writing out all of the words multiple times. Many of my students are in chorus also, so they would understand this concept of function by using the musical term “chorus.”


Functions simplify algorithms by grouping steps similar to the way some people communicate ideas with emojis. I might introduce the topic by discussing the meaning of a few social media posts where emoji are used in place of a phrase or clause.


Since I’m teaching in a Catholic school, I use rosary beads to explain functions.


Again I would relate this to science with my students and experimental variables.


Functions are a piece of code you do over and over again.