Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Python Visual Tutorial (csail.mit.edu)
159 points by prog on Aug 30, 2010 | hide | past | favorite | 25 comments


To my surprise, a lot of people don't know there exist things called debuggers. Debuggers are tools that let you step through code, see variables, set break points. Debuggers are common for compiled languages, less common for scripting languages. For example, you can debug Java code from most IDEs, or C++/C# code from Xcode or Visual Studio.

http://en.wikipedia.org/wiki/Debugger


hi (i'm the guy who created this app) ... the purpose of this app is to be an educational tool (e.g., visualizing how data structures change over time), so it's not really filling the same role as a symbolic debugger.


when I first saw this, I was thinking to myself "great, someone threw PDB into a web app" and was going to write it off until I saw that on every step of the way, you actually also visually output the contents of all the variables. In PDB, you have to manually know what's there and explicitly type in the command to inspect it. People learning how to program don't know where all the knobs are, much less which one to push.

There's power to such simplicity, and I immediately forwarded it to people I know are new learning programming in Python right now. Good stuff, keep it up!


pylons web framework has something akin to PDB in a web app


I just walked through a simple sort routine and that is very cool. Thanks!


What just occurred to me is that I've never really needed a debugger using Python. Maybe it's just the problems I've been solving with it, but the runtime reflection capabilities of python help me catch most of the sort of bugs that I'd use a debugger for in C. (Which happen far less in Python anyway since I spend so much less time manipulating variables.)

So I think that's probably the reason why they're less common. With scripting languages it takes a lot longer to reach the point where you start searching for tools to make your life less painful.


Debuggers aren't necessary to get someone excited about programming. This tool definitely has its place.

My niece recently asked me how to learn to program. Since she not extremely tech literate, I gave her a pointer to Zed Shaw's book. We had two sessions together to get her up to speed. These included going through the pre-reqs of learning to to use the command line, creating and editing .py files, the differences between the interactive interpretor and executing scripts, how to read a traceback. She stuck with it, but it took away from some of her interest.

If I had to start again, I would definitely point her to this app.


> Debuggers are common for compiled languages, less common for scripting languages.

First, if your bourne shell scripts have grown so much you need a debugger, you might want to consider there are other issues than the lack of a debugger for the bourne shell.

Second, there are debuggers for bash, zsh and ksh. And probably others many other shells.


I think scripting language here is more in reference to python/ruby/perl which are sometimes used for scripting and get grouped into that category


> I think scripting language here is more in reference to python/ruby/perl

Given all of them have multiple debuggers, I thought that the original comment couldn't imply that as that would make it entirely and irredeemably wrong.

Also, screw the qualifier "scripting language" for full-fledged general-purpose programming languages. Erlang is sometimes used for scripting, does that make it "a scripting language"?


At the ILC 2009, Bill Lewis showed his Omniscient Debugger, which is a proof-of-concept debugger that allows you to navigate backwards in time to find a problem.

http://www.lambdacs.com/debugger/


gdb has had reversible debugging since 7.0: http://en.wikipedia.org/wiki/GNU_Debugger#Features


And OCaml has had a time-traveling debugger since forever.


hi (i'm the guy who created this app) ... if anyone finds security vulnerabilities, please email me (and don't rm -rf my account hehe). i put this up a few months ago as a small hack to teach people Python, so it wasn't meant to be pounded by 1337 h4x0rz. thanks!


I KNEW that nick looked familiar. Though this probably isn't the place for it, I felt the need to tell you that your "Advice for Grad School Applications" essay was my bible for apps last December. I just moved to palo alto and will buy you a beer any time you want.


cool, thanks. please email me personally (i can't find your email addr from your HN profile)


One of my goals is to use this app as the foundation for some free online introductory programming tutorials. Unfortunately, I don't have much free time right now to pursue this goal; but if you're interested in getting involved, please email me!


I might be interested, do you plan on open sourcing this ?


The idea of a code stepper is pretty cool. Two other projects that come to mind after seeing this: http://jonnytran.com/machina/ and the Macro Stepper in Racket: http://docs.racket-lang.org/macro-debugger/index.html


I'm teaching someone Python on the side, and this is a great help! Thanks!


I'm thinking about how this would change my niece's learning path.

Obviously it would omit things like argv, files, the os module. I've seen working with IO to be extremely valuable. She was able to quickly write fill in the blank form letters and simple interactive scripts. But there is plenty one can do with just print and loops.

Unfortunately I see that raw_input(), dir(), and __builtin__ all raise problems. My niece was extremely excited to find out about all the 'hidden' objects that she could play with.


sorry, those modules were omitted due to obvious security concerns ;) raw_input() sounds like something reasonable to include, though, since it could simply pop up a text box and ask the user to input a string. please email me if you have other suggestions for how to improve this app. thanks!


I support your idea of supporting raw_input through a pop up. You may run into problems with the browser supporting them. For one thing it will not be the result of a user action. If it isn't an acceptable experience, perhaps a dynamic inline form in the "output"?


A full HTML popup window shouldn't be necessary:

    javascript:alert("hello, " + prompt("what is your name?"))


cool, please email me if you have suggestions for making this more useful (or bug reports!!!)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: