Live data from Hacker News

Notebooks Are McDonalds of Code

yobibyte.github.io

61–70 of 153 posts

Re: Notebooks Are McDonalds of Code

#61

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 .

They should put it in an excel spreadsheet. Then it would be carefully documented and be immediately retired, no possible way to outlive its usefulness.

https://xkcd.com/2730/

Re: Notebooks Are McDonalds of Code

#62
>Same with notebooks, you can write NASA-production-grade software in a notebook, but most likely you won't.

One of my family members literally maintains a software platform for test bedding production NASA spacecraft at JPL and it is all on top of Jupyter notebooks.

People are literally on course to build AGI and there’s a good chance that large portions of that work will be done within Jupyter notebooks.

To suggest real work doesn’t get done in notebooks is simply asinine.

As I have embedded further into data science and machine learning teams within my career I have come to learn that a lot of the things software engineers care about around maintainability, reusability etc. are often completely antithetical to data science productivity. In many cases practitioners would consider some of the listed cons of notebooks as features rather than bugs.

There is obviously a time and a place for pulling out those practices in such settings but blindly applying software engineering standards to this kind of work is both all too common and often rather counter productive.

If notebook style dev doesn’t jive with you personally I get that, and god speed. I’ve worked on CV/ML teams with a lot of CS degree grads and they don’t always want Jupyter notebooks. However, I’ve noticed a tendency for folks to extrapolate that to blanket statements about notebooks in general. As someone who has inherited and had to clean up many jumbled/bad notebooks I’m empathetic but I would challenge folks to lean into considering more about the circumstances the previous notebook author was working in and what kinds of productivity outcomes they were responsible and prioritizing rather than casting judgement on said author or their tools of choice.

Re: Notebooks Are McDonalds of Code

#64
In the context of machine learning, notebooks are a crutch people lean on when the production environment lacks the right abstractions--isn't convenient enough. Notebooks fall under the "prototype smell" in Google's Hidden Technical Debt in Machine Learning Systems (2015).

I agree that notebooks are best reserved for exposition.

Re: Notebooks Are McDonalds of Code

#65
With a few constraints and best practices, notebooks tend to be delightful to use. I've taught many teams to be successful with them over the years.

Certainly you can shoot yourself in the foot with notebooks, but you can also footgun with many other tools.

Re: Notebooks Are McDonalds of Code

#66

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.

This is the crux of a lot of the anti-notebook rhetoric.

I spend a good deal of time covertly teaching software engineering best practices to folks who claim they don't want to be "software engineers", yet they are in front of Jupyter most days.

Re: Notebooks Are McDonalds of Code

#67
post #41

Notebooks are primarily a _teaching_ tool, not code or an experimentation interface. I know that's not how they're used, but it's really bizarre to me that people use them for exploratory data analysis. They're great for teaching and for _documenting_ the results of exploration, but fairly bad for any type of interactive data exploration, let alone actually writing code. Frankly, notebooks are pretty terrible for exp…

Not sure if this is sarcastic or not...

I've taught and worked with some of the biggest companies in the world. They were using Jupyter and sound EDA to great effect.

Re: Notebooks Are McDonalds of Code

#68

This is a great article. For me, a lot relates to scale. I use notebooks occasionally for the university classes I teach. I like how I can write equations and text to explain ideas, and present interactive graphs to illustrate the ideas. But it's quite a lot of work to set things up, and there can be a problem when components of the work take a long time. In my research work, it is common for a calculation or a graph…

Wholly agree and can't for the life of me figure out why you're being downvoted, other than people disagreeing with the tenor of your opinion.

Re: Notebooks Are McDonalds of Code

#69

Earlier quoted context omitted.

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.

This is the crux of a lot of the anti-notebook rhetoric. I spend a good deal of time covertly teaching software engineering best practices to folks who claim they don't want to be "software engineers", yet they are in front of Jupyter most days.

Thank you for your service. ;-)

I'm a so called "scientific" programmer, and I use notebooks. I care about good programming practices, and have made an effort to improve my craftsmanship.

And I don't want to be a software engineer. I'm surrounded by SWE's in my work area, and their job doesn't really interest me. Division of labor. I'm glad somebody enjoys it.

Re: Notebooks Are McDonalds of Code

#70
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 would have to re-run script from the beginning - this is not productive in scientific experiments, where you need to re-run certain parts of your code and tune/change parameters, try different things.

if your calculation is long running you would not be as productive as could be in notebooks

Post reply on HN