4 ms·
I think this persistent state is one of the main advantages of the notebook environment, or the Matlab workspace, which I guess it was inspired by. It allows yo
by mjlm 10y ago
I think this persistent state is one of the main advantages of the notebook environment, or the Matlab workspace, which I guess it was inspired by. It allows you to quickly try alternative values for certain variables without having to re-calculate everything. Saving snapshots would not be feasible if the project contains large amounts of data. If you want to reset everything, just "run all" from the beginning, or use a conventional IDE with a debugger.
- yomritoyj 10y agoBut you cannot recalculate if your calculation has trashed your inputs.And if it hasn't then the snapshot does not impose a cost. If you are willing to forego the opportunity to replay to save memory, just put the producer and consumer in the same cell.
- lqdc13 10y agoIt is essentially already that if you are careful with the variables. Currently, you can easily control which things are saved and which aren't. So it is the best of both worlds.
- rhodin 10y agoNo, not Matlab but Mathematica: "We were inspired originally by the excellent implementation in Mathematica" [1]. [1] http://ipython.org/ipython-doc/dev/whatsnew/version0.12.html#an-interactive-browser-based-notebook-with-rich-media-support http://ipython.org/ipython-doc/dev/whatsnew/version0.12.html...
- brians 10y agoAnd that came from Emacs and old Lisp environments---and perhaps something yet earlier? As late as 2000, this was the single biggest advantage and single biggest impediment to new programmers in MIT's 6.001 lab: a bunch of nonvisible state, mutated by every C-x C-e. The student has tweaked two dozen points trying to fix a small program, and re-evaluated definitions after many of them, but maybe not all. The most straightforward help from a teacher is to get the buffer into a form such that M-x eval-region paves over all that, sets a known environment of top level definitions, and---more than half the time---the student's code now works. I have similar concerns about much of Victor's work, for the same reason. Managing a mental model of complex state is a n important skill for programming, but it's best learned incrementally over long experience with more complex programs. These very interactive environments front load the need for that skill without giving any obvious structure for helping the student learn. Contrast Excel and HyperCard, which have no invisible state: you can click and see everything.