Thread: Managing cognitive load when introducing sub-programs.
Had a great discussion with @httcs.online (PS - ooh nice handle!) about this the other day. Here's my suggested approach.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Thread: Managing cognitive load when introducing sub-programs.
Had a great discussion with @httcs.online (PS - ooh nice handle!) about this the other day. Here's my suggested approach.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Now you can start to 'reveal' the magic hacks/shortcuts. Call one sub from within another. Use a returned value as an argument for a different sub. Calling from a print or as part of a calculation. Let them create from solid foundations
Fin
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Now you can start to 'reveal' the magic hacks/shortcuts. Call one sub from within another. Use a returned value as an argument for a different sub. Calling from a print or as part of a calculation. Let them create from solid foundations
Fin
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
www.instagram.com/reel/DDcU-1M...
www.instagram.com/reel/DDcU-1M...
Data going in and out of the sub program. Now we can make our calculator useful. I teach to get user input in the main then send the arguments to the subs, which do the calc and return the answer into a variable in the main.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Data going in and out of the sub program. Now we can make our calculator useful. I teach to get user input in the main then send the arguments to the subs, which do the calc and return the answer into a variable in the main.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Now introduce data going IN to the sub program. Still super simple examples here (adding two numbers etc).
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Now introduce data going IN to the sub program. Still super simple examples here (adding two numbers etc).
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Just procedures first. Let students practice defining, calling and the new flow of a modular program without the extra load of parameters and return values.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Just procedures first. Let students practice defining, calling and the new flow of a modular program without the extra load of parameters and return values.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
I introduce them just after teaching about decomposition so they fit in with what students have just learned. Up to then I have taught the basic programming skills/structures of output, input, variables, selection & iteration
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
I introduce them just after teaching about decomposition so they fit in with what students have just learned. Up to then I have taught the basic programming skills/structures of output, input, variables, selection & iteration
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Be super careful about your language. Call them sub-programs/subroutines or whatever fits your curriculum. BUT - procedures and functions are TYPES of sub-program and should be introduced as such.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Be super careful about your language. Call them sub-programs/subroutines or whatever fits your curriculum. BUT - procedures and functions are TYPES of sub-program and should be introduced as such.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
... they ARE right (for the moment). Explain that you've simplified the subs because you want them to just practice defining and calling. This does seem overly complex, but makes the a MUCH better CS thinker & programmer with bigger tasks later.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
... they ARE right (for the moment). Explain that you've simplified the subs because you want them to just practice defining and calling. This does seem overly complex, but makes the a MUCH better CS thinker & programmer with bigger tasks later.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
If you've followed step 4 then some students will probably ask you why they just can't write a sequential program - that's a much simpler way of achieving the same result right?
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
If you've followed step 4 then some students will probably ask you why they just can't write a sequential program - that's a much simpler way of achieving the same result right?
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Your subs shouldn't do anything especially complex (and DEFINITELY no new skills) for a while. Just getting used to defining and calling is plenty for the working memory to be getting on with.
Simple outputs/calculations at first.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Your subs shouldn't do anything especially complex (and DEFINITELY no new skills) for a while. Just getting used to defining and calling is plenty for the working memory to be getting on with.
Simple outputs/calculations at first.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Next, return values. Hard coded calculations that return the value back to the main program. I teach to ALWAYS assign the return value to a variable (one thing per line) for use in the main program. No parameters yet.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Next, return values. Hard coded calculations that return the value back to the main program. I teach to ALWAYS assign the return value to a variable (one thing per line) for use in the main program. No parameters yet.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Just like with all my teaching, I go the long way round. Make your examples do one 'thing' per line as much as poss - no function calls print statements etc. Reducing the syntactic density of each line really helps new learners.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot
Just like with all my teaching, I go the long way round. Make your examples do one 'thing' per line as much as poss - no function calls print statements etc. Reducing the syntactic density of each line really helps new learners.
#TeamCompSci #CASchat #CSed #CSK8 #CSScot