Live data from Hacker News

Notebooks Are McDonalds of Code

yobibyte.github.io

91–100 of 153 posts

Re: Notebooks Are McDonalds of Code

#91
This is a very narrow minded take. Notebooks are used mostly by scientists who are just using code as a research tool. Being able to explore to learn is incredibly useful. Using them in production is a perfect bridge between different disciplines. And if you get distracted because “your browser has tabs” that’s really not the notebooks fault.

Re: Notebooks Are McDonalds of Code

#92
post #9

Earlier quoted context omitted.

It’s a REPL, for starters.

REPL stands for Read–eval–print loop https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93prin... A REPL, by its name, is a very narrow version of the broader paradigm of interactive computer programming environments. But Notebooks are not REPLs, unless you use REPL to mean "interactive programming environment" and not REPL. Notebooks are much broader than a REPL! In a notebook, you can go back and edit and run in…

I’m not sure what distinction you’re trying to make. Maybe you can give some examples of notebooks that are not REPLs, since some of them definitely are. For example, Wikipedia says Jupyter Notebook is a REPL. The bare Python REPL (and the command line REPLs in any language, for that matter) has the exact same issue with tracking state, because what you describe is a problem with all REPLs, and all notebooks that are REPLs. That isn’t generally a serious problem with command line REPLs, because those REPLs aren’t meant or used for large system programming, they’re for trying small experiments. The parent article is pure opinion and seems a bit confused about the idea of using the right tool for the job, because command line REPLs and notebooks both have their place, as do IDE projects with lots of files.

“A Jupyter Notebook application is a browser-based REPL containing an ordered list of input/output cells which can contain code, text (using Github Flavored Markdown), mathematics, plots and rich media.”

https://en.m.wikipedia.org/wiki/Project_Jupyter

Re: Notebooks Are McDonalds of Code

#93

Earlier quoted context omitted.

"In a notebook, you can go back and edit and run individual lines of the notebook without re-running the whole notebook from the start and without re-computing everything that depends on what you just edited." Isn't this a standard on REPLs as well? You can select the code you wish to run, and press Ctrl+Enter or what ever. I must admit, I've programmed Python for about 10 years in Spyder and VS Code now, but I haven…

> Isn't this a standard on REPLs as well? You can select the code you wish to run, and press Ctrl+Enter or what ever. Not usually, no. Type `python` at the command prompt - what you get is a REPL. Type `clisp` at the command prompt, or `wish`, or `psql`, or `perl` or even `bash` - those are al REPLs. Very different to a program that presents an editor, and then lets the user selectively choose which lines/expressions…

Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? Selectively choosing which lines to run is just a convenience to let you not have to type the whole line or set of lines again, it doesn’t really change the base interaction with the interpreter.

Re: Notebooks Are McDonalds of Code

#95
post #5
post #3

I think people may be misusing notebooks. They aren't there to develop software but serve as virtual versions of scientific notebooks (hence the name). They are there to conduct experiments (changing parameters and the like in your code) and to record and plot the results. You don't have to develop the software itself in the notebook.

I can change parameters in a script. What's the advantage?

I think the workflow improvement happens but it's not because notebooks allow you to do something that you can't do otherwise. They just improve ergonomics.

For example, there are a lot of cases my team uses notebooks for proofs of concept where we make a large expensive call to load a large chunk of data, slice a small piece of it, iteratively try to reprocess the piece until you get the reprocessing to occur the desired way, validate it reprocessed correctly, and then extend the reprocessing the the rest of the data set. That can all be done after only making 1 expensive call. Further more, if the last cell evaluation fails, it just resets you back to the line before and you can retry it.

Can you do this with a script? Absolutely. You can write a script to download the data, and a script to process the data, and sub scripts for the individual steps. But that's not the path of least resistance; the path of least resistance involves you having to edit a piece and recompile everything and reset the entry point. Avoiding really makes it easier to brute force to the desired state ASAP.

Re: Notebooks Are McDonalds of Code

#97
post #93

Earlier quoted context omitted.

> Isn't this a standard on REPLs as well? You can select the code you wish to run, and press Ctrl+Enter or what ever. Not usually, no. Type `python` at the command prompt - what you get is a REPL. Type `clisp` at the command prompt, or `wish`, or `psql`, or `perl` or even `bash` - those are al REPLs. Very different to a program that presents an editor, and then lets the user selectively choose which lines/expressions…

Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? Selectively choosing which lines to run is just a convenience to let you not have to type the whole line or set of lines again, it doesn’t really change the base interaction with the interpreter.

> Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL?

For the same reason that adding (working) wings to a car makes it not a car anymore.[1]

I mean, to my mind, when something is satisfying a different primary use-case, then that thing is a different thing.

I'm sure there's some fuzziness in the distinction between "This is a REPL/car and this is a Notebook/plane".

Usually it's very easy to see the distinction - the REPL is waiting for the next command and the next command only while the notebook takes whatever input you give it, determines whether it got a command or content, and reacts appropriately.

[1] Tons of examples, TBH. I don't refer to my computer as my calculator, even though the computer does everything a fancy calculator can do. People don't call motorcycles 'bicycles', even though the motorcycle can go anywhere that a legal bicycle can go. More telling is how people don't call their computer monitor 'TV' and don't call the TV a 'Monitor' even when the same actual item is used for both (i.e. I repurposed an old monitor as a small-screen netflix-box, and now an item that used to be called 'monitor' by wife and kids is called 'TV' by wife and kids).

Re: Notebooks Are McDonalds of Code

#98
It’s disappointing to have someone’s misguided hot take get lots of attention. There’s nothing inherently wrong with Notebooks, just like there’s nothing inherently wrong with a command line REPL. They are tools. Sure, neither is a great choice for coding a million-line application, and yet the REPL is the better choice for one-liners, and the notebook is the better choice for a few plots or developing a 10-line algorithm. I’d rather read something thoughtful about when and how and why to migrate from a notebook to something better. Making that easier, without judgement, is going to do a whole lot more good than attempting to shame people with a bad analogy will do. Anyway, McDonalds has scaled larger than any other food chain in the world, so the title is accidentally paying a huge compliment to Notebooks.

Re: Notebooks Are McDonalds of Code

#99
post #93

Earlier quoted context omitted.

Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? Selectively choosing which lines to run is just a convenience to let you not have to type the whole line or set of lines again, it doesn’t really change the base interaction with the interpreter.

> Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? For the same reason that adding (working) wings to a car makes it not a car anymore.[1] I mean, to my mind, when something is satisfying a different primary use-case , then that thing is a different thing . I'm sure there's some fuzziness in the distinction between "This is a REPL/car and this is a Notebook/plane". Usually it's ve…

a flying car with wings is still a car. that's the whole point of it. it can drive you to the airport and drive like like a car. I don't care what you call your computer, it can still do math. people who have their TV hooked up to their computer would more readily refer to it as a monitor. idk, I just think REPLs are kinda shit for interacting with the present state of a kernel (as Jupyter calls them). Jupyters better, but still kinda shit because it could automatically infer the important variables in scope and keep a watch list like a debugger does. And then suggest things to do with them since it's a repl and not an IDE. but the thing is fundamentally they're Read Edit Print Loop interfaces to the computer and its current working state.

Re: Notebooks Are McDonalds of Code

#100
post #93

Earlier quoted context omitted.

Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? Selectively choosing which lines to run is just a convenience to let you not have to type the whole line or set of lines again, it doesn’t really change the base interaction with the interpreter.

> Why would adding fancy select or cut-and-paste features to a REPL make it not a REPL? For the same reason that adding (working) wings to a car makes it not a car anymore.[1] I mean, to my mind, when something is satisfying a different primary use-case , then that thing is a different thing . I'm sure there's some fuzziness in the distinction between "This is a REPL/car and this is a Notebook/plane". Usually it's ve…

Ugh this is a gish gallop of broken straw man analogies. Being able to select and evaluate a single line in a notebook is nothing like adding wings to a car. Fundamentally, selecting a line to evaluate is no different from typing that line again. It’s a shortcut and nothing more, the interaction is still read-eval-print. Note REPL doesn’t even refer to where the input comes from, the point is simply that it handles your input, processes it, displays the result, and then waits for you for more input. This is as opposed to executing a file where the interpreter exits once the execution is completed, and the return value is not automatically printed.

Jupyter Notebook absolutely is a REPL, see my sibling comment above for the WP link describing it as such. It waits for input, then evals the input, the prints the return value, and then loops.

Post reply on HN