4 ms·
Literate programming / ipython notebooks make me very uncomfortable. Primarily the problem is that it's a living body of mutable state -- like an Excel spreads
by Myrmornis 9y ago
Literate programming / ipython notebooks make me very uncomfortable.
Primarily the problem is that it's a living body of mutable state -- like an Excel spreadsheet, except it doesn't auto-update -- if I poke at some bit of it, and then re-evaluate a cell, some state will change, probably. And then maybe other cells' outputs will be invalid. Hmm, maybe I should re-evaluate the whole notebook? Oh, but some of the cells contain shell commands, for example to download a dictionary file from norvig.com. Do I want to do that? Maybe I should just undo the change I made. The ipynb is in git of course. But instead of a nice diff showing lines of code, the python code is held inside some JSON document.
Ipython notebook is beautiful technology, the front-end is really-well done. But accumulating all that mutable state goes against all my instincts as a programmer. I prefer editing .py files in my text editor, with Make when necessary. And then creating output from input with a single, transient, execution.
- abecedarius 9y agoIs there a mode to rerun everything on every update? That's how my https://github.com/darius/halp https://github.com/darius/halp works, and it's fine for working out code with cheap test cases. You wouldn't want to do that for data analyses that take even a second, but I've found myself using it a lot to develop code.
- emj 9y agoYes this is a problem when the notebooks grow, but where do you draw the line, the work flow Jupyter uses is perfect for exploratory coding, but it gets complicated quickly
- Myrmornis 9y agoYes, to be honest I do much more programming than exploratory data analysis currently. FWIW, here's how I use it when I want to use Jupyter: - Write all my python code in .py files as usual. - The Jupyter notebook contains calls to functions generating graphical/HTML/etc output, nothing else. - Either use one of the various `reload*` functionalities to update the state of the persistent python process, or use `ipython console --existing` to create a conventional ipython shell sharing the same kernel as Jupyter and evaluate code in there.