5 ms·
several steps backwards from even just editing code in Windows notepad. Maybe for you. For myself (a professional data scientist) and every other professional
by nerdponx 6y ago
several steps backwards from even just editing code in Windows notepad.
Maybe for you. For myself (a professional data scientist) and every other professional data scientist I have worked with, notebooks are useful and better than Windows Notepad, otherwise we would all be using Windows Notepad.
This is such a strongly worded post that I have to wonder what exactly you are trying to do with notebooks, that makes it not just suboptimal but atrocious. Because it sounds like you're using it for something other than its intended purpose, in which case of course it's atrocious, because you're using a tool for something other than what it was designed to do.
If you think of a notebook like a tool for literate programming, then sure, I can see why you might have issues with them. They don't integrate well with text editors, other tooling such as test runners, or even the Python import system. I would strongly recommend against writing a library in Jupyter. I would strongly recommend against writing low-level CUDA code in a Python notebook. I would weakly recommend against writing production ETL pipelines in a notebook (although if your ETL pipeline is just untested spaghetti code, you might as well do it in a notebook).
Notebooks are not competing with IDEs, text editors, or any other dev tooling. Notebooks are an alternative to REPLs. If you use a notebook like a super-powered REPL, you are going to get a lot out of it. I can't think of a single complaint about a notebook that can't also be leveled at an "Editor+REPL" type of workflow, and I can think of many problems with the Editor+REPL setup that are solved by notebooks.
If you prefer using Spyder and RStudio with the console and plot window, that's great. I honestly do too. There is a lot to dislike about Jupyter Notebook and Jupyter Lab specifically. But notebooks in general, and Jupyter specifically, are still the most efficient tool I've found for doing something, keeping track of / taking notes on what I did, and displaying the results in a way that I and my colleagues can easily understand what I did.
There are also other notebook formats such as RMarkdown and Pluto, both of which have much nicer plain-text representations than Jupyter Notebook. I'm a big fan of those, too. But there are tradeoffs in every design and I'm not about to malign the Jupyter project (or its ancestor IPython) for its choice to use JSON.
- monkeybutton 6y agoWorking on an analytics team myself, I strongly agree with everything in your reply. I just want to nitpick one bit: >weakly recommend against writing production ETL pipelines in a notebook I find prototyping and developing ETL code in notebooks to be the most efficient. Especially when dealing with new and unfamiliar data sources. The interactivity and feedback loop makes defining what an ETL process should be doing a lot easier. That said, once it's working, everything should get moved out into a module with tests.
- deleted 6y ago[deleted]
- qsort 6y ago> For myself (a professional data scientist) and every other... The key qualifier is 'from a development perspective'. Notebooks do have their usefulness. I do some data-science related tasks but I'm mostly a developer, so admittedly that could skew my perspective. > If you think of a notebook like a tool for literate programming... I mean, that's kind of a selling point of notebooks, though... > They don't integrate well with text editors They don't integrate well with anything, not even other notebooks! From that alone I sense strong Word vibes. > If you prefer using Spyder and RStudio with the console and plot window, that's great. My usual setup is pretty much the same as yours with Visual Studio Code, but yeah, that was the point... So notebooks are at least somewhat competing in the same space as IDEs after all? Is there a subtlety I'm missing or "I prefer IDEs" and "Notebooks are not competing with IDEs" are in direct contradiction? > keeping track of / taking notes on what I did, and displaying the results in a way that I and my colleagues can easily understand what I did. Again, I'm not arguing with that, I was talking about notebooks as a development tool. I can very well see the appeal of notebooks as a presentation/storytelling/documentation format, and to an extent even I agree they have their usefulness there, and I certainly have no qualms with their usage in that niche. But I just couldn't bear to sit in front of Jupyter instead of VSC to code something, hence my strong wording.
- sfifs 6y agoNotebooks are primarily a discovery tool when you're exploring your data, deciding what ETL transformations and feature engineering to create and testing algorithms. When you want to run stuff in production, you move to a regular code dev environment (or handoff to developers). Now some things in business are infrequent enough that you can live with Jupyter for the once a quarter or so when you need to rerun updates but that's not the same as production code that runs daily/weekly.
- nerdponx 6y agoMy point is that notebooks are not a development tool, so it makes no sense to criticize them from that perspective. Nobody is asking or even suggesting that you develop software in a notebook, and I haven't met anyone who does it. Spyder and RStudio are very much not oriented toward traditional software development and very much oriented toward interactive work between the text editor window and the console/REPL window. That is, they are fancy implementations of the Editor+REPL workflow. The fact that you can develop software in that kind of environment is not the point.
- cozzyd 6y agoThe problem with a notebook (that you don't have with a REPL) is the execution order is sort of arbitrary and changes don't propagate well. A notebook is great if you don't change anything, but at that point it's basically a REPL with inline graphics, which is usually what I really want...
- kortex 6y agoThis is both a pain (state gets confusing) but this statefulness also a huge boon when rapid prototyping. You don't need to rerun calculations to tweak a single variable. Sometimes the data preprocessing can be really expensive. It does take a certain discipline to make reproducible notebooks. I like to always end the day with a "restart and run all" if possible.
- cozzyd 6y agoRight I guess what is needed is some way for cell dependencies to be known, so that all cells that depend on a changed cell will automatically update.
- prestonh 6y agoJust restart your kernel if you think something spooky related to state is occurring. This is the number one criticism I see of notebooks, but it is so easy to deal with if you are aware of it. The benefits of being able to rerun an isolated part of your code far outweigh the harms IMO.
- tikej 6y agoIts done in Pluto.jl - Julia notebooks that have cell dependencies implemented (and rerun them upon change of variable’s value).
- kortex 6y agoMaybe I am misunderstanding how the system works but I don't actually want that kind of Excel-like eager behavior like 90% of the time. Sure it's neat for simple computations but some cells take hours to run in my workflow. Give me an indicator that a cell is stale but I don't want eager execution on all the time.
- kkoncevicius 6y agoDon't know about Jupyter, but been using Rmarkdown for as long as they are available. Recently, however, I am moving away from Rmarkdown and I don't miss it. IMO their ideal use case is in tasks like communicating homework exercises to a teacher. Or for tiny stand-alone projects. The problems they are designed to solve are, supposedly, numerous: reproducibility, literate programming, interactive exploratory analysis. But they end up getting in the way more than helping. 1) Reproducibility: nothing in the notebook is more reproducible compared with a simple source file. And you cannot really reuse anything within the notebook. Notebooks make re-running the written code more convenient for people not familiar with your stack. But, like mentioned above, it looses its appeal in any substantial project, where you will not be able to share the whole data that fuels the notebook. 2) Literate programming: it works only when you don't change anything, or make the notebook very abstract. If you do an analysis on a prepared dataset, add some comments, draw some pictures, then you have a "literate programming" document. But it lives only as long as nothing is changed. If you change the dataset it depended on you will likely have to change the comments in the notebook. You cannot just re-run it. And the comments added to the notebook - in my experience - nobody reads them, besides the original author. Almost every time somebody sent me a notebook I had additional questions about the results, which required me to interact and ask questions. It just adds additional burden on your part to describe what you do two times: once in the code, and another time in text. You can either guess what the recipients will be asking about and try to cover all corners, or simply answer those questions directly in a shorter amount of time. 3) Interactive exploratory analysis - notebooks slow it down. Writing simple functions in an editor and sending them to a REPL or simply exploring things in the REPL directly - both are faster alternatives. With notebooks you have to care about presenting the figures and pictures and comments from step one. In a typical exploratory analysis you are just trying things out without any idea of preserving them, before you stumble upon something useful. 4) On top of all that notebooks make things difficult to change. Say you have a notebook that loads 3 datasets, compares them with pictures and tables, transforms them, then compares them some more. And you decide to change the color of one picture. You either will have to re-run this notebook from the start just to change the picture. Or, alternatively, you start using cache, which, in my experience, is never a better option. Just adding an alternative opinion.
- mint2 6y agoI like notebooks for eda and some prototyping but then move to vs code. From my experience, the the problem is many people in DS positions or who start with notebooks are unaware of what editors are for and don’t have much grasp on code maintainability or collaboration. They simply don’t know what they don’t know so their notebooks are spaghetti code mixed with tons of random things being displayed that was a sanity check for them at the time but now not even they know why they printed or displayed it.