News for hackers. Stuff that matters.
Re:Norvig's Python programs to practice or demonstrate skills by Myrmornis on Monday November 27, 2017 @01:49PM (#15789955)
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.

Re:Norvig's Python programs to practice or demonstrate skills by emj on Monday November 27, 2017 @07:17PM (#15793095)
Yes 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
Re:Norvig's Python programs to practice or demonstrate skills by Myrmornis on Monday November 27, 2017 @07:42PM (#15793233)
Yes, 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.

Re:Norvig's Python programs to practice or demonstrate skills by abecedarius on Monday November 27, 2017 @02:08PM (#15790164)
Is there a mode to rerun everything on every update? That's how my 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.