2 ms·
I found this very interesting, because it's an example of a problem which can be very subtle when just looking at the code -- but the errors become very obvious
by vilhelm_s 16y ago
I found this very interesting, because it's an example of a problem which can be very subtle when just looking at the code -- but the errors become very obvious when plotted.
It raises the question of what other programming problems could also benefit from visualizations like this -- Aldo Cortesi's work on visualizing sorting algorithms (http://sortvis.org/ http://sortvis.org/) comes to mind.
Also, wouldn't it be cool if IDEs supported this kind of thing natively? You could imagine a plugin for Eclipse so that each time you have a function of type
int f(int x, int y)
it would let you right-click on it and instantly plot the output... (obviously it would require some care to deal with side-effects).