3 ms·
> I think the whole selling point of notebooks is their literate style... I get this angle and I agree to an extent, demos/throwaway code is where they really
by qsort 6y ago
> I think the whole selling point of notebooks is their literate style...
I get this angle and I agree to an extent, demos/throwaway code is where they really shine, but I don't entirely buy the "literate" aspect (disclosure: I assist in some DS tasks but I'm mostly a developer, so that might skew my perspective).
Knuth's WEB, love it or hate it, was at least arbitrarily and easily composable, notebooks on the other hand have hidden state and plenty of footguns even for those who are already familiar with the language. It's basically impossible to compose notebooks in any meaningful way.
I think you could make the idea work (or at least work better) with a purely functional language, say Haskell, instead of Python. Purely functional semantics are more amenable to natural interpretations closer to the Notebook format than an OOP.
- stingraycharles 6y agoJust a random example I encountered the other day, take a look at this: https://github.com/huggingface/transformers/blob/master/notebooks/02-transformers.ipynb https://github.com/huggingface/transformers/blob/master/note... It’s a tutorial on how to use some NLP ML library. It’s a pretty excellent example of where this format shines, imho, and as you can see it’s absolutely literate. Btw I also identify as primarily a developer, but over the past few years been confronted with these notebooks more and more and I’ve learned to appreciate their use over time. But as with all good things, they’re sometimes overused.
- cashsterling 6y agoThis is one of the selling points of Pluto.jl for Julia... less hidden state for interactive coding. https://github.com/fonsp/Pluto.jl https://github.com/fonsp/Pluto.jl
- krapht 6y agoThe one thing about Pluto that turned me off is that when you export to PDF it puts an advertisement in the header and footer for Pluto. It was embarrassing to send my work to non-technical people.
- nerdponx 6y agoThe whole accusation of hidden state makes no sense to me. Jupyter Notebook has "restart & run all" button. It's no different from keeping a REPL open all day. If you don't restart your REPL before re-running your program, you have at least as much of a hidden state problem as any notebook. And don't get me started on spreadsheets. Composability... eh. You can run a Python notebook from the command line just like a Python source file. You can even run one notebook from another, or "compile" the notebook to Python source and import from it. But that somewhat of an "off-label" use to me. The idea is not to be a general-purpose literate programming tool, although it turns out to be pretty close to one. It's a notebook, like a lab notebook. You do stuff and take notes on that stuff, and it keeps the results of what you did + your notes all together in one file that can be rendered to HTML or PDF. That's fucking fantastic IMO. Once you're at the point where you're trying to compose a lot of notebooks you should strongly consider opening an IDE and developing a project-local library instead. Or at least using some kind of task runner / data flow engine thing. I hate to be the "no true Scotsman" guy about notebooks, but all of this anti-notebook invective just doesn't make sense to me. Go ahead and write all you want about how notebooks are not an IDE replacement - that's fine, and nobody (at least nobody that I respect) ever claimed they were.
- kbelder 6y agoIt reminds me a bit of programmers who condemn any large Excel sheet, saying that it should be moved into a database. What it usually means is that they don't understand the problems it's solving.