Java Visualizer
© 18 Sep 2013 Luther Tychonievich
Licensed under Creative Commons: CC BY-NC-ND 3.0
other posts

Learning to Program

A tool for exposing what a computer is actually doing.

 

I teach, among other courses, “‍Introduction to Programming‍”. Because of the strange power of the private corporation known as “‍The College Board,‍” I teach it using Java.

Few people I talk to in CS education circles thinks that Java is the right language to teach, but it does have its good points. It’s memory managed, it’s fast, it’s almost portable, and it runs an increasing percentage of the mobile devices of the world. But I find the biggest selling point of Java as a teaching language to be the very reason I almost never write Java outside of teaching: it is verbose. I have translated code to and from Java from and to languages from Fortran and C++ through Python, Javascript, and OCaml. I cannot readily recall any time that the Java version didn’t take more lines with more characters per line than did the same algorithms in the other language.

Verbosity is useful when teaching. It exposes things that a student could otherwise miss. But there is a lot of Java (and every other language) that is not exposed: in particular, computers are so very fast that the temporal aspect is almost completely invisible. It is slightly more visible with an imperative language like Java than with something like OCaml, Haskel, or Forth; but it is still mostly hidden.

So I decided to try to expose it. I wrote up a partial Java interpreter in JavaScript JavaScript: the de-facto assembly language of the web. and added as much exposure of the timing as I could. The visualization chosen was inspired in part by Bret Victor’s article Learnable Programming. The current version can be found here. I’ll probably continue to add more and more functionality as time goes on.

Feel free to hammer away at it and make suggestions in the comments below. I’m not yet convinced the visualization I have is the right one.




Looking for comments…



Loading user comment form…