Jupyter Notebooks are great. They help you visualise your code line by line easily, and are quite very powerful. But you might not want to use them; here’s why.
No clear structure
If you’ve looked at pretty much any tutorial working with Jupyter Notebooks, then it’s likely you’ve seen packages being imported haphazardly in different lines on a notebook, in between other code.
Of course, the correct place to import packages is right at the top of the program.
This is not a problem inside Jupyter Notebooks itself, but it’s just not the right way of doing things.
So if you end up converting your .ipynb file to a .py one, you’ll end up getting an error when you try to run your program. Because Python starts each program from the top of the script.
Less thinking, more trial and error
Oftentimes, I see folks using Jupyter Notebooks just try different variations to their code to try and get to the ‘right’ code, without really understanding why the code works.
For the record, I’ve been guilty of this sometimes, too.
Writing in a IDE like Atom, Sublime, or other text editors almost forces you to think about why your code works and why it doesn’t.
No autosuggestions, indents, customisations
Jupyter Notebooks do provide some suggestions. For instance, using ‘tab’ shows you the relevant, context-specific code you can use in a given line / command.
But in a most modern text editors, you can get these suggestions as you type, instead of having to specify you want the suggestions by using ‘tab’.
Then there’s the fact that there are no indent guides available. This is okay when your functions or loops are fairly short. But if they’re say 10 lines or more, then you’ll almost certainly want indent guides. Especially if you’re working with nested loops.
Other limitations
Then there’s the fact that there are no line numbers. And again, this is okay for short programs, but it just makes life a tad bit harder when you’re working with larger programs.
The same is true for syntax colours, too. Jupyter’s syntax highlighting is incredibly limited. For instance, take a look at this short for loop on Jupyter Notebook:
And here’s the same code on Atom:

I don’t know about you, but I find the syntax highlighting on Atom much easier to read vis-à-vis Jupyter’s.
That being said…
Notwithstanding all the cons above, I still think and believe Jupyter Notebooks are great for learning how to code.
The lack of customisations is limiting. However, it’s also a great thing since it’s simpler.
And when you’re learning how to code, you want to make your learning experience as simple as possible.
Feature Image by Émile Perron on Unsplash

Leave a Reply