I wrote a in-browser java-esque debugger for my students ( http://www.kapparate.com/kj/ . Click the compile button in a javascript enabled browser ), and I’m trying to figure out what would be the best way to visualize the variables in the current scope. Right now, I’m printing them as JSON:
6 KJDB> 7 STACK {"x":"hello","y":"hello","a":4,"z":5,"xx":-5.6400000000000015,"c":true,"intArray":[5,90,35,45,150,3]}
So that represents x, y, a, z, xx, c, and an intArray. The respective values are there too.
However, some of my students are in middle school, and this kind of notation has been confusing at times. Should I use a table (each row being a different variable?). Or perhaps something graphical with rectangles representing variables?
A two column table, with names and values. When you get to talk about method invocation and possibly recursion you might want to use different borders to mark different stack frames. Or you could mark stack frames with a single a column heading containing the method name.