I found a good compromise by using VSCode Python extension. You can import Jupyter notebooks as Python scripts and the other way around [0]. If I need to work on a notebook, I prefer working with a Python script and the interactive window [1]. Then I commit both script and ipynb version.
Agree 100%. Only thing Iād add is that the killer feature of the extension is that it allows one to treat ordinary python files as notebooks (without converting!) by 1. Connecting to a persistent kernel instance 2. Allowing the user to use magic comments to delineate code cells within the python file. With these two things, and the ability to export as a real notebook, you get the great experience of a notebook ā submitting easily editable cells to a kernel one at a time, as many times as you want ā without of all the usual baggage that that would entail. Plus you get to edit in a decent editor (and edit things other than just python files in it) instead of the crap Jupyter forces you to use.
VSCode's solution is awesome. Rmarkdown works the same way, and it makes a lot of sense. Let code live as plaintext, it's native format, and only render results at runtime. Trying to preserve results in the file just makes things needlessly stateful.