Live data from Hacker News

Online Python Tutor: Learn programming by visualizing code execution

pythontutor.com

21–30 of 46 posts

Re: Online Python Tutor: Learn programming by visualizing code execution

#21
this is awesome, learning from visualizing how the code is executed IMO is a great way to learn to code. To add to that, its teaching python which I believe is already very easy to read and learn, brilliant. If this doesn't make it easy for young students learn programming for the first time then I don't know what will ! great job !

Re: Online Python Tutor: Learn programming by visualizing code execution

#22

Is there a self-hosted option for this? I think this would be an excellent resource for my students, but I'm having trouble getting my examples to run. (memory overload?)

Please email me examples that fail to run. It might be memory overload, or just other weird server crashes. (My alert dialog message isn't particularly informative.)

Online Python Tutor isn't meant for running large examples. Think of it as a "digital whiteboard"; I don't think anyone would expect to visualize a 100,000-step program with tons of pointers on a whiteboard :)

Re: Online Python Tutor: Learn programming by visualizing code execution

#23
It's not exactly Python (or I'm doing something wrong). Which is very confusing / "dangerous" for people learning Python (They will learn it wrong and not have the xp/confidence to question tutor)

locals() and globals() are undefined.

Still crazy slick (if it were the early 90's I'd say "l33t") bit of coding.

Re: Online Python Tutor: Learn programming by visualizing code execution

#24

Just 5 days ago HN was all so negative about Bret Victor's visions[1] of how programming should be taught. And yet here we are, looking at a working example of one of the ideas he wrote about. [1] - http://news.ycombinator.com/item?id=4577133

Bret has certainly been an inspiration to lots of us who work in this field, but I still don't think this is an implementation of his vision. To truly implement his vision, someone would need to design a new programming language and environment. My motivation has been to ease the learning path for an existing popular language (Python).

I have been thinking of such a language for several years. Now that life programming environments are getting traction, I might be able to bootstrap the process and program my ideated language on top of one of them.

See this 2003 PhD thesis at MIT for two examples of existing languages designed to take full advantage of live programming environments. (Flogo I -graphical- and Flogo II -textual): http://llk.media.mit.edu/papers/ch-phd.pdf Particularly interesting is Flogo II capability to mix the imperative and functional-reactive programming paradigms in the same code block, as parallel runtime processes; I hadn't seen that before.

Re: Online Python Tutor: Learn programming by visualizing code execution

#25
Looks good.

However, my big criticism of these sorts of visualisations is they seem to be entirely geared towards imperative programming. Has anyone seen similar visualisations for more functionally structured code?

Oh, I see you can write your own code to be visualised. Here's a simple list comprehension: http://pythontutor.com/visualize.html#code=myList+%3D+range(...

Not the most enlightening visual.

Re: Online Python Tutor: Learn programming by visualizing code execution

#26
This would have been really useful when I was learning Python on Udacity and was confused by the behavior of = and += on lists and tuples.

This should definitely be integrated into Udacity and other learning platforms! Most instructors have to do this by hand in CS 101 lectures anyways.

Re: Online Python Tutor: Learn programming by visualizing code execution

#27

Looks good. However, my big criticism of these sorts of visualisations is they seem to be entirely geared towards imperative programming. Has anyone seen similar visualisations for more functionally structured code? Oh, I see you can write your own code to be visualised. Here's a simple list comprehension: http://pythontutor.com/visualize.html#code=myList+%3D+range(... Not the most enlightening visual.

Generators are similarly confusing to visualize... http://pythontutor.com/visualize.html#code=def+fib(n)%3A%0A+...

Re: Online Python Tutor: Learn programming by visualizing code execution

#28

Looks good. However, my big criticism of these sorts of visualisations is they seem to be entirely geared towards imperative programming. Has anyone seen similar visualisations for more functionally structured code? Oh, I see you can write your own code to be visualised. Here's a simple list comprehension: http://pythontutor.com/visualize.html#code=myList+%3D+range(... Not the most enlightening visual.

Checkout DrRacket's debugger. Obviously not as well documented as this, but amazingly insightful.

Re: Online Python Tutor: Learn programming by visualizing code execution

#29

Just 5 days ago HN was all so negative about Bret Victor's visions[1] of how programming should be taught. And yet here we are, looking at a working example of one of the ideas he wrote about. [1] - http://news.ycombinator.com/item?id=4577133

Bret has certainly been an inspiration to lots of us who work in this field, but I still don't think this is an implementation of his vision. To truly implement his vision, someone would need to design a new programming language and environment. My motivation has been to ease the learning path for an existing popular language (Python).

To clarify: I didn't mean that it was whole his vision, nor did I thought you was inspired by his recent text (someone mentioned in the other thread that your tool is around for months). But this is a living example of one of the ideas he discussed in his last essay (even if this example is independent of and older than the essay itself).

Re: Online Python Tutor: Learn programming by visualizing code execution

#30
A big plus for most people out there. I'm a visual learner myself. I've always had trouble in the early stages of learning because I didn't really realize I was a visual learner until later on. Also, college professors didn't give simple tips like you should draw out diagrams of what's happening in the code because that helped me out a lot.
Post reply on HN