Jupyter, how it shouldn’t be used

Gabriel Kasser
2 min readAug 4, 2024

--

Provocative? Let me explain.

In the world of data science and Python development, Jupyter notebooks have become ubiquitous. However, are they really the best tool for the job, especially when it comes to debugging?

Let's take a critical look at Jupyter notebooks and compare them to the often-overlooked Python debugger.

The Pitfalls of Jupyter

1. Inconsistent State: Unless you restart the kernel each time, your notebook’s state can become inconsistent with your code.

2. Limited Application State Visibility: You often end up littering your code with print statements to understand what’s going on.

3. Production Nightmare: Integrating Jupyter notebooks into a production environment? Good luck with that!

4. Basic Debugging: Forget about advanced debugging techniques. You’re stuck with manual, block-by-block execution.

5. Performance Issues: Memory overload and block-by-block execution lead to sluggish performance.

6. Navigation Nightmare: Try navigating through a notebook that’s 400 pages long. It’s a labyrinth!

7. Limited Tooling: You’re pretty much on your own when it comes to additional tools and features.

8. Poor Syntax Highlighting: The cherry on top? Subpar syntax coloration.

The Professional Solution: Python Debugger

Now, let's look at why the Python debugger is a superior choice for serious developers:

1. Guaranteed Repeatability: Each execution is consistent and repeatable.

2. Complete Application State Visibility: You can see everything, including plugins for visualizing image variables and tensors.

3. Smooth Production Integration: With the right entry point, moving to production is a breeze.

4. Advanced Debugging Capabilities: Step-by-step execution, conditional breakpoints, remote debugging, function introspection - you name it!

5. Optimized Performance: No more memory bloat or slow execution.

6. Intuitive Code Navigation: Easily navigate your code architecture.

7. Rich Ecosystem: Auto-completion, linters, and more at your fingertips.

8. Git-Friendly: Version control becomes much easier.

The Million Dollar Question

So, why do so many people still use Jupyter?

A. For one-off data analysis focused on visualization
B. They haven't mastered the Python debugger

If you answered B, don't panic! Learning to use a debugger is a skill that can be acquired. And trust me, it's life-changing.

Hot Take

Jupyter is a one-trick pony that will never compete with a good debugger in the long run.

PS: Want to visualize images while debugging in VSCode or Cursor? Check this out https://github.com/elazarcoh/simply-view-image-for-python-debugging.

#Python #Debugging #DataScience #SoftwareEngineering

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response