Both Jason and I got confused with the order of teaching. Specifically in Section 1, we were to act out “line-length” and “collide?”. In Section 2, we were to write “line-length”. By this time, Jason had collide? and line-length scrambled in his head. I think that next time I teach it, I would do “line-length” all the way through, then act out “collide” and then code “collide?”. To you see any issues with that?
That's how we did it last year, and some teachers reported that students were failing to see the big picture for how "line-length" and "collide?" were supposed to work together. I'm certainly game to switch it back, though.
- I made a note to myself for next time to go ahead and teach the optional lesson on conditions, since Jason was confused when he tried to write the condition for line-length. Specifically he has trouble with the first part of each condition, where you write the code that will tell you if you should execute the rest of that condition.
- Jason had trouble writing “collide?” and when I asked him to reflect on what would have helped him to see it more easily, he replied “write the Circle of Expression” first. In general, he and I have not been doing that. I am considering annotating my classroom notes to add in “have students draw the Circle of Expression”, at least for these harder functions.
I am confused when it comes to the usefulness of writing out EXAMPLE. Specifically:
A. On the design recipe page, I am always confused as to if I am just supposed to hard code in the number the function should return, with the given inputs, or show some kind of algorithm there (or write specific Racket code, with numbers instead of variables).
I can see how circling the “things that change” can help kids transition from the concrete to the more abstract, but I can’t yet write a condition myself! (Guess I need to study the answer guide harder!).
B. I was under the (mistaken?) impression that the compiler actually compared your Example to your Define statement and would tell you about errors. Does the EXAMPLE statement get compiled or run? If so, could you give me an example of how it would help you catch an error? Maybe I am expecting too much out of it??
You're correct - it does check your code. Try typing this into a blank WeScheme window, and see what happens when you click run.
; double : Number -> Number
(EXAMPLE (double 2) (+ 2 2))
(EXAMPLE (double 5) (+ 5 2))
(define (double n) (* n 2))
Clicking the link will highlight the example that didn't match the code, helping you find the bug.
When I code, I write one EXAMPLE, and then copy-and-paste it for the second EXAMPLE and change each of the inputs. Then I copy that EXAMPLE and change "EXAMPLE" to define, and then each changeable value to a variable. If I have to use (cond..), I copy all of the examples, and then filter them out into unique conditions before replacing values with variables.
Let me know if this is helpful?