zlacker

[return to "My Favorite Programming Problem to Teach: Digit Length"]
1. svnpen+Jm[view] [source] 2019-11-11 03:14:08
>>jstrie+(OP)
> As a result, solutions using strings are disallowed on problem sets and quizzes until they are taught. However, the few students who have prior Python programming experience may be tempted to find digit length without loops using a variant of the following (for our purposes) invalid solution.

Wow. this is one of the reasons I hated school. No programmatic reason what given for why a string solution couldnt be used, only an arbitrary reason. Here students may have knowledge from self teaching or whatever, but they are unallowed to use that knowledge because "reasons".

To any teacher that thinks its a good idea to punish students for thinking outside the box: shame on you. All youre going to end up doing is crushing enthusiasm and/or creating drones. Please dont.

◧◩
2. userbi+xo[view] [source] 2019-11-11 03:43:26
>>svnpen+Jm
Strings are disallowed because they are not necessary for this problem and although the solution is shorter, is far more inefficient; it also doesn't demonstrate the algorithmic thinking that the course is obviously trying to teach.

I've taught CS courses before, and have seen plenty of self-proclaimed self-taught know-it-alls who seem to be more stackoverflow-copy-pasters than anything else.

◧◩◪
3. svnpen+To[view] [source] 2019-11-11 03:48:03
>>userbi+xo
> Strings are disallowed because they are not necessary for this problem

the division examples are not necessary either, thats the point. you can solve it different ways, that doesnt mean one way is not necessary, it just means its different. one may be faster, one may be more readable. If you dont allow different solutions you cant explore the tradeoffs between them.

◧◩◪◨
4. jstrie+Dh1[view] [source] 2019-11-11 15:06:13
>>svnpen+To
I note that the solution is invalid at the bottom of my post, but it is worth mentioning that I know all of the students in the group session when I teach this problem, and I am familiar with their background. If I know that a student has prior Python experience, I will discuss the string solution with them, but let them know not to use it in their homework until strings have been covered in class.

In this case, even though the solution is disallowed for grading purposes, there is an opportunity to discuss it during the lesson.

[go to top]