18 ms·
It's not hard, but I the issue is a stupid way of teaching procedural programming in the first place, not a student with mental difficulties. When you've been
by exDM69 10y ago
It's not hard, but I the issue is a stupid way of teaching procedural programming in the first place, not a student with mental difficulties.
When you've been taught that computers process a sequence of operations (ie. statements, not actual instructions), from the top to the bottom, it's difficult to imagine "start from the beginning, but rename all variables and substitute some values". Recursion is a bit hard when you do it in assembler (need to explicitly work with the stack), but that's not the mental model we typically use in programming. Yet, it's often the model that the students encounter first.
I really liked the SICP lectures from 1980s where the lecturer goes ahead and demonstrates recursion with evaluating expressions by writing them on a blackboard with chalk. It also demonstrates the space and time complexity of the evaluation.
This is why I think that beginner programming lectures should be more focused on expressions than statements. More functional, less procedural.
- JadeNB 10y ago> I really liked the SICP lectures from 1980s where the lecturer goes ahead and demonstrates recursion with evaluating expressions by writing them on a blackboard with chalk. It also demonstrates the space and time complexity of the evaluation. I agree! The author does just this when demonstrating the difference between the naïve recursive implementation of `length`, and the tail-recursive one using an accumulator. I don't know if he or she did so with the student, but I thought it was a nice pedagogical touch in the post.