I am still slowly trying to wrap my head around why you should not use jupyter notebooks (they are cool for plenty of stuff).

I think most of it is because, I feel everyone is putting everything into them. functions are better in a package where you can test them and then you can call the function with your specific argument from a notebook.

what are the issue you see in the use of notebooks?

@defuneste
I think because you end up with one file for everything because people won't store functions away, it's bad as a development environment, it consumes more resources than it should.
@statquant I fail to see on how they can be correctly use for dev. but it could be because of tool or because I have not find a good way to use the tools effectively...
@defuneste
I can tell you what we did: we built a way to drive jupyterlab from neovim so you write everything from neovim in a proper dev env and jupyterlab becomes your "gui"
@statquant that is one solution!
@defuneste In a workshop I'm writing, I have participants code functions in the notebook where they can iterate and test. I then tell them to move them funcitons to a Python script to demonstrate reuse.
@spara Do they do it? I feel it is like refactoring your code (never happen). I see plenty of folks treating their cells as "functional units": I need to run A then B and D (or sadly sometimes A, D B...) but not putting those functional units into function...

@defuneste

I hope they do after taking my workshop. But bad habits die hard. My goal is to move folks from notebooks to production code.

@spara yeah I am trying to understand why people develop those bad habits, is it because jupyter is very friendly, because we already add a lot of complexity ...

(I hope your participants will keep their good habits)

@defuneste

It's a new version of spaghetti coding; folks have been doing it for ages. It's a simple model to follow when you're starting out.

My personal opinion is that folks want an answer and not an education on how to code. The coding version of "people want a 3/8" hole, not a 3/8" drill bit and drill."

@spara you probably correct... bringing back the boulder on top of the hill again and again

@defuneste @spara

I have to jump in here and say something. I've played with coding for decades, since the early 1980s. And I can hack together a working script when the need arises. And I recognize all the terms and phrases you're using in this thread.
But I have no freaking idea what either of you is talking about here.
Just an observation.
🤔

@GeoDon @spara that is not complicated, mostly we have a bunch of jupyter notebooks everywhere, they are executed with very users specific environments, that most of the time we have no idea about and i would like to (need to)
"organize" a bit.
@defuneste @spara
I gathered it was something like that.
It's just funny how listening to some of my programmer friends on here reminds me of my early days, reading books on learning how to code.
Chapter One - "A step-by-step guide on how to display 'Hello World' on your monitor"
Chapter Two - "Let's take a deep dive into Object Oriented Programing"

@GeoDon @spara

this is kind of the issue we need some intermediary chapters between "Hello world" and "use all the fancy stuff that we like right now"😅

Since I am still "young and rebellious" like @AtanasE I believe in the power of education!

Edit:plenty of typos

@defuneste Since a notebook file is binary, and often quite large, you can't really use it in a git repo.
@Micha_Silver yes that one if the issue but version control is sadly way over some people...

@defuneste For Jupyter specifically.

You can’t meaningfully track changes in git, i.e. I can’t look at a diff and tell exactly what has happened in your notebook.

Supporting something like Jupytext or getting people to make them plaintext python files is a challenge. Plus another thing to do as a DevOpsy person.

Cell outputs get stored as strings or whatever.

People rarely seem to run a Jupyter notebook from top to bottom, and there is no cell dependency graph, therefore reproducibility is highly questionable.

That’s why if you ARE going to use a notebook for Python I suggest Marimo.

@defuneste I think my issue is they're a compromise that is bad at communicating the two things that are in them, the method (code) and the results (text and graphics):
- if you want to share code with people, notebooks tend to be spaghetti code, with lots of things not clearly put into functions, just duplicated cells with minor variations. Any interesting or significant code should be in a separate file anyhow, so they're hard for others to understand
- if you're presenting results and graphics to people, who normally can't code, they need a separate presentation anyway, you can't share the notebook with them, which they won't know how to run, and a presentation/email is quicker and clearer.

If you want images inline with Python I think the iPython is good, but with all your code in 'normal' python files.

(Oh and the git issues others have mentioned, but that's secondary for me.)

@hl very good points!