Live data from Hacker News

Notebooks Are McDonalds of Code

yobibyte.github.io

11–20 of 153 posts

Re: Notebooks Are McDonalds of Code

#11
I like notebooks because they let me see the result of immediately and i can trace my steps

having said that when i see Jupyter notebook I close the tab and do not continue

theres just a sense of dread that I can't explain...perhaps its PTSD from data structure/algorithm comp sci courses that i never completed.

Re: Notebooks Are McDonalds of Code

#12
post #4

I've never been a fan of notebooks, it always felt like a strange way to run my code. What's the real advantage over creating scripts? If I want my code to run somewhere I would need to notebook architecture or just turn it into a normal script anyhow

of course, running a script from start to finish is better when it's fast, but if your code is slow to run, each cell acts like an in memory cache of your previous work.

Re: Notebooks Are McDonalds of Code

#14
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?

You can't embed graphs in a script, and plotting is an important part of systematic research. Also, it is easier to have an obvious sequential set of experiments over months in a notebook rather than a bunch of scripts. It's the same reason scientists use lab notebooks to keep track of things rather than just a bunch of loose papers.

Re: Notebooks Are McDonalds of Code

#15
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 am guessing you don’t do data science or data forensics? Inline styled tabular outputs and graphic plots while exploring data is very handy!

Edit: jinx!

Re: Notebooks Are McDonalds of Code

#17

Some of the worst code I've seen in my life lives in Jupyter notebooks. But that's fine, it's meant to be throwaway code. The problem is a lot of places/people do not use it as such .

In general anything written by nonprofessional programmers in pursuit of some other goal is terrible code by professional programmer standards.

On the other hand, it accomplishes a goal other than getting a programmer paid. So in one important sense is objectively better than probably 80% of the code I've seen people paid to write, no matter how nicely it was constructed.

Re: Notebooks Are McDonalds of Code

#18
post #5

Earlier quoted context omitted.

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

You can't embed graphs in a script, and plotting is an important part of systematic research. Also, it is easier to have an obvious sequential set of experiments over months in a notebook rather than a bunch of scripts. It's the same reason scientists use lab notebooks to keep track of things rather than just a bunch of loose papers.

Yes, I have a lab notebook and I work in a lab. However I use folder structures to organize my scripts and as for graph outputs I save them as files. In my line of work I generate hundreds of graphs for data analysis verification and a notebook isn't set up to handle things like that as far as I can tell

Re: Notebooks Are McDonalds of Code

#19
If there are complaints about code quality in a jupyter notebook, chances are that someone is doing it wrong -- either the author is using it for demonstration purpose, for production or near production environment, or the person looking at others' notebooks is taking them too seriously.

Most code in jupyter notebook is bad, but that's fine, because nobody should waste time doing that unless they must reproduce the results or they are sharing the notebook with others.

Notable example of high quality notebook: https://youtu.be/zduSFxRajkE

Post reply on HN