logoalt Hacker News

drnick111/04/202510 repliesview on HN

Are there any other people who hate notebooks? Give a plain old script anytime. Run and edit anywhere without extra packages or even a Web browser.


Replies

OkayPhysicist11/04/2025

Notebooks aren't competing with scripts, they're competing with REPLs.

ML and scientific applications in particular tend to have segments that run for a long time, but then you'd like the resulting script to be in a state where you can mess with it, maybe display some multimedia output, etc, without re-running the long-running segment. Notebooks fit this need to a tee.

bragr11/04/2025

I've found that notebooks are great for ad hoc reporting and analysis scripts. Once you have your quick and dirty script, it is trivial to convert to a notebook and you get a lot for little. Being able to change one cell and rerun just that is a godsend for getting reports "just right", and the "show your work" and visual aspect make them much more consumable and trusted by other people.

verdverm11/04/2025

Notebooks are closer to using a repl than a script.

One key feature is that you can run a long data-prep/processing step and then iterate on whatever comes after without having to re-run the compute intensive steps to get the data (i.e.) you want to graph

Another key feature is learning and sharing knowledge. Images, markdown, graphs, links, code... all interwoven. Scripts do not have affordances for these things. In this sense, Notebooks can be closer to reproducible blog posts.

marcoalopez11/04/2025

Jupiter is excellent at what it is designed for. For example, my usual workflow is as follows: when I develop a tool or model, I do so in a plain Python file. I then import the file from the notebook to create figures, demonstrations, documentation and so on, resulting in an immediate document that my colleagues and I can easily use for discussion. It's as simple and effective as that. It is also a great tool for teaching coding to beginners. Of course, notebooks are not designed for code development. Also, nowadays, if you want to, you can open notebooks in dedicated apps.

show 1 reply
victorbjorklund11/04/2025

notebook are great when you wanna see the intermediate results and not just the final result (in case last step takes time and you wanna double check the data) or when you just wanna better understand what the code does (yes, you can set up a debugger and debug a script etc but that is just more pain)

nixpulvis11/04/2025

I have no real qualms with the idea of a notebook, as long as it's not adding a lot of custom magic. I should be able to share what I'm working on, iterate in a notebook with someone, then extract it into a standalone program without much thought.

show 1 reply
7moritz711/04/2025

*anywhere that has the python runtime installed

ironically that makes jupyter more portable via colab

AnotherGoodName11/04/2025

I do think notebooks are very flawed right now even if the concept is sound. Right now they are essentially an IDE without the ability to produce publishable output (you are literally expected to ship the project in the form the IDE works with) and they are not a very good IDE at that.

They need reliable dedicated published output fit for general public consumption. This means a static (no backend host required) sharable .html file where end users can view all the data and run the code samples that doesn't try to present as an IDE. I actually wrote https://rubberduckmaths.com/eulers_theorem in Jupyter but had to manually copy and paste to a new well formatted static html file and re-paste the code blocks into Pyodide enabled text areas within that html since the export functionality is a mess. The result of the manual work means i now have an easily sharable and easily hosted static html file with working Python code samples as it should be but... Why don't Notebooks have a published form like this already? It seems pretty obvious that Notebooks are your IDE, they shouldn't be the output you present. We're literally asking users today 'to view this notebook install Jupyter/Marimo/whatever and open from there' when the Notebook is designed to create the publication rather than a place to view it. In general the output i demonstrate above should be the minimum bar that Notebook 'export' features should hit. Export as a static .html file with working code. As someone who manually 'compiles' notebooks it's not hard to do yet Notebooks simply don't have an actual working html export right now (i know there's technically a 'html' export option in Jupyter but it will strip out your code and create a terribly poorly formatted document as output).

The IDE aspects themselves, at least for Jupyter (the one I've tried out the most), are a bit too simple too. Yes it's nice to have alternating 'text' blocks followed by 'code' blocks but that's really all they are right not. I want something more complex. I want the code blocks shown to actually be windows to a full python project. Users should be able to change the code shown and view the larger, well structured Python code. Right now it's text, followed by simple code. Not much more honestly. As it is right now i feel Notebooks only work for really simple projects.

If you have a complex Python project i agree the way to only share it is to share the Python project as is. Notebooks could be a wonderful explanatory wrapper to a larger project but right now they just aren't good at doing much more than the simple 'here's some data' followed by 'here's the code i used to process that data' and they don't even present that particularly well.

show 1 reply
culi11/04/2025

notebooks are great for sharing code with people who might have only a cursory knowledge of coding. It also helps highlight specific sections of code. Graphs and other outputs immediately proceeding the block of code that generates them can be really helpful as well

If a "script" gets too long and complicated, and it's a project I intend to present to others, I often reach for a notebook to organize the code in a more digestible format

paradox46011/04/2025

I'm more amused by them than anything. They're mostly just a reinvention of literate programming, via web or org mode or whatever