The article and comments debating best practices in notebooks remind me of the time I hosted a website from a jupyter notebook. Technically, I was using gradio to create a localhost webpage and then piping it through cloudflare. The website would only work when the notebook was running on the cmd line of EC2. Hey if it works, it works! Notebooks allowed me to do a 2 week project in 2 hours. Like most things, notebook…
Notebooks Are McDonalds of Code
141–150 of 153 posts
Re: Notebooks Are McDonalds of Code
#142In 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.
I don't think I've met a single data scientist or ML person who used Python and didn't use notebooks. What are the "right abstractions" that everyone seems to miss?
Re: Notebooks Are McDonalds of Code
#143Earlier quoted context omitted.
I agree with the quote, but this was code that we did modify frequently. It was still ok. 1600 line func is bad, but 1600 line file, well that's what editor splits are for. A lot of app backends don't do much other than shoving stuff into a DB and getting it back.
> I agree with the quote, but this was code that we did modify frequently. Could still be the best approach, if by "modify" you meant "added new queries to an array of strings".
Re: Notebooks Are McDonalds of Code
#144It's absolutely hilarious that the author opens with an image of Socrates. Socrates, as you recall, famously argued that writing was a detriment to thinking. The parallel that notebooks are a sign of lazy thought does not go unnoticed.
Re: Notebooks Are McDonalds of Code
#145It's absolutely hilarious that the author opens with an image of Socrates. Socrates, as you recall, famously argued that writing was a detriment to thinking. The parallel that notebooks are a sign of lazy thought does not go unnoticed.
Being against coding in a code notebook is more like saying "yellow highlighter on sticky notes is a bad medium for serious writing"
Re: Notebooks Are McDonalds of Code
#146It's absolutely hilarious that the author opens with an image of Socrates. Socrates, as you recall, famously argued that writing was a detriment to thinking. The parallel that notebooks are a sign of lazy thought does not go unnoticed.
That is really not a valid parallel at all because code notebooks are only one particular form of coding. Being against coding in a code notebook is more like saying "yellow highlighter on sticky notes is a bad medium for serious writing"
Re: Notebooks Are McDonalds of Code
#147Earlier quoted context omitted.
Sometimes I need to run my code in small pieces for testing and evaluation, I do this with multiple smaller scripts. Data can be saved to files and this accomplishes nearly the same thing as a notebook without needing to have the notebook environment
Sure, if you don't mind the overhead (both development and processing time) of loading/saving state to disk (about 10-30 minutes for a lot of my data). In notebooks you don't have to think about it since it's just the objects in memory (and indeed they don't make it easy to think about it, which is a reasonable criticism, but I don't currently know of a framework or system which gives you the advatages of both).
Re: Notebooks Are McDonalds of Code
#148Some 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 .
Re: Notebooks Are McDonalds of Code
#149Recently, since coming across FastAI and nbdev[0], I've been moving increasingly to a more notebook-centric flow. So far it's been better particularly for the exploration aspect where I've primarily used ptpython in the past (and this isn't anywhere ML-related). I think the idea behind nbdev is pretty neat, but it pushes some practices that I'm not a fan of at all. I want to get to the point where I have a mostly com…
I remember Jeremy from fast ai was an advocate for notebook centric flows. But I have to respectfully disagree that he is a good authority on maintainable / scalable coding practices like this. And though I may be wrong, I feel like the fast ai lib itself is a not too useful wrapper around pytorch and people would be better served just learning pytorch itself. I say this as someone who watched a year of the fast ai v…
Re: Notebooks Are McDonalds of Code
#150Earlier 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…