Works great on iPad -- well done!
Online Python Tutor
11–20 of 50 posts
Re: Online Python Tutor
#12Re: Online Python Tutor
#13The tool is awesome, but I wouldn't rely too much on the instruction bounds. For example, the greatest sums exercise ( http://people.csail.mit.edu/pgbovine/python/question.html?op... ) can be solved in six "steps" for all input lengths, while it's certainly no O(1) business. def maxPairSum(data): return sum(sorted(data)[-2:]) # one "step"
Re: Online Python Tutor
#14Although I like these kind of tools, I doubt that they're useful to learn basic programming as they need a lot of prior knowledge to be present to already understand the visualization. For example, what is a stack or heap to a novice programmer? What will the effect of this visualization be on their construction of an operational understanding of basic programming language concepts? And these constructs, will they be…
Having been a teaching assistant for intro programming classes targeted at non-CS majors, I disagree. You don't need to understand what a 'stack' or 'heap' is to understand what's going on and for this to be useful. And even if it's too complicated to be useful for people on their own, being able to use something like this as a teaching aid would be very helpful. The number of people who have trouble grasping even wh…
The student will construct their own knowledge of programming by some learning process. This tool has an effect on that process, as has every tool. It could, for example, let some students construct an understanding of a variable that makes it harder to start learning about, say, memoization in dynamic programming. (This is just an conjectured example, mind)
I don't say it will, and I do have to say that the visualization given is quite nice and sound. But because we, as experienced programmers, like a tool because it visualizes how we think about programming and program execution, that does not mean that this is transferable in a similar way to novice programmers. As a high school computer science teacher I have been growing more and more worried about so called anti-didactic inversion in programming education. Especially at lower levels of education.
In programming education, we often use professional programming tools with professional programming languages and professional measures of programming quality. When students are learning to become professional programmers, this is a good idea. But is it as good an idea for teaching programming to those who do not want to become professional programmers. Or for those who are learning programming as a basic skill (like math, language, etc)?
Re: Online Python Tutor
#15Although I like these kind of tools, I doubt that they're useful to learn basic programming as they need a lot of prior knowledge to be present to already understand the visualization. For example, what is a stack or heap to a novice programmer? What will the effect of this visualization be on their construction of an operational understanding of basic programming language concepts? And these constructs, will they be…
Teachers and students have been drawing pictures like this on the blackboard, or on paper, for a long time. Many experienced programmers visualize these pictures in their imagination (unless they're implementing a familiar pattern). That can be tedious and error-prone. Why not let the computer show you what it's doing?
Many debuggers already show some of what this tool does, but I've never seen one quite like this.
Can you give an example of a "more complex programming structure" where this would be detrimental to understanding?
Re: Online Python Tutor
#16Where was the aliasing?
Re: Online Python Tutor
#17The tool is awesome, but I wouldn't rely too much on the instruction bounds. For example, the greatest sums exercise ( http://people.csail.mit.edu/pgbovine/python/question.html?op... ) can be solved in six "steps" for all input lengths, while it's certainly no O(1) business. def maxPairSum(data): return sum(sorted(data)[-2:]) # one "step"
Actually, both your solution and theirs are not O(1). Theirs is n^2, while yours is n lg n due to the use of a sort function. The best way to do this would simply be to find the largest element, ignore that element and find the largest element again, which is O(n).
In other words, he was pointing out the limitations of the tutor program's analysis.
Re: Online Python Tutor
#18The tool is awesome, but I wouldn't rely too much on the instruction bounds. For example, the greatest sums exercise ( http://people.csail.mit.edu/pgbovine/python/question.html?op... ) can be solved in six "steps" for all input lengths, while it's certainly no O(1) business. def maxPairSum(data): return sum(sorted(data)[-2:]) # one "step"
Actually, both your solution and theirs are not O(1). Theirs is n^2, while yours is n lg n due to the use of a sort function. The best way to do this would simply be to find the largest element, ignore that element and find the largest element again, which is O(n).
def maxPairSum(lst):
if lst[0] > lst[1]:
top, top2 = lst[:2]
else:
top2, top = lst[:2]
for i in range(2, len(lst)):
if lst[i] > top:
top, top2 = lst[i], top
elif lst[i] > top2:
top2 = lst[i]
return top+top2Re: Online Python Tutor
#19Although I like these kind of tools, I doubt that they're useful to learn basic programming as they need a lot of prior knowledge to be present to already understand the visualization. For example, what is a stack or heap to a novice programmer? What will the effect of this visualization be on their construction of an operational understanding of basic programming language concepts? And these constructs, will they be…
Using this tool, a student would get a visceral sense for what the stack and heap are, from experience (even if nobody had mentioned those words before). e.g. "Pointers point at stuff on the heap." Teachers and students have been drawing pictures like this on the blackboard, or on paper, for a long time. Many experienced programmers visualize these pictures in their imagination (unless they're implementing a familiar…
It is difficult to imagine what kind of knowledge novice learners will construct while using this tool. I could imagine, for example, that their operational meaning of a variable becomes that of consecutive boxes with values in them. Given that knowledge, how would such a student start to understand a variable in a closure? Will it fit their existing understanding of variables as boxes? Maybe it does, maybe it will not. Maybe they have to deconstruct their understanding of variables first to connect it to their budding understanding of a closure, building a deeper and more widely understanding of variable. Maybe this will be not too much of a problem. Maybe this becomes a hurdle. We don't know unless we try it out, of course.
Learning isn't an exact science. I think that dynamic representations like this one are very useful in teaching and learning. However, I would also argue to use these tools with care and conscience. Although it seems to fit our operational view of a program, that does not mean it is a good fit of a novice learner's operational view of a program. Whatever tools we use will influence that operational view. What I want to ask teachers is to evaluate and reflect on the best way and place (in space/time) to use these tools to make learning as optimal as possible.
Re: Online Python Tutor
#20The tool is awesome, but I wouldn't rely too much on the instruction bounds. For example, the greatest sums exercise ( http://people.csail.mit.edu/pgbovine/python/question.html?op... ) can be solved in six "steps" for all input lengths, while it's certainly no O(1) business. def maxPairSum(data): return sum(sorted(data)[-2:]) # one "step"