Both Thonny and Visual Studio Code are built in to the Raspberry Pi OS. They’re both capable of running Python scripts and useful when you want to make stuff move using the Raspberry Pi. But there can only be one IDE for a Pi user, and this guide should help you choose which to use!
What’s an Integrated Development Environment (IDE)
IDEs are feature-rich programs used to build software with any of the programming languages they support. Modern IDEs come with all the necessary features you need to do something. They boast lints, compilers, interpreters, a view of your folders, and sometimes even a way to upload code to a microcontroller board. They make the whole development process much easier.
Pros/Cons of Thonny
Thonny is an open-source platform that’s dedicated to Python and only Python. It’s an IDE for beginners, mostly because of its easy-to-use GUI.
As soon as you start it up, you can basically just type what you want and save it as if you were using Windows Notepad.
- Easy startup – Thonny opens up quite fast. As soon as it does, you can type code in a new “Untitled” file. This makes it great for writing quick code.
- Has all the basic Python tools – You don’t need to open a new tab or install more software to make Thonny run Python. It’s usable as is.
- Doesn’t have much of a learning curve – It’s easy to find where you could run, pause, and stop Python scripts. Plus, the Shell is quite visible at the bottom.
- No support outside Python – While it’s certainly possible to use it as something like a Notepad to write code in other languages, it can’t run them as you would do with Python. It doesn’t even come with a C compiler!
- No folder tray (built-in explorer) – Unlike most other modern IDEs, Thonny does not show you the folder you are working on.
Pros/Cons of Visual Studio Code
A free and open-source “code editor” by Microsoft, Visual Studio Code can be extended to a full-blown IDE by installing premade extensions. Alternatively, you can make your own extensions and contribute to the growing community of Visual Studio Code extension-makers.
- Multi-language support – Use of Visual Studio Code doesn’t just have to end with Python. You can use most programming languages with it as long as you have the right extensions.
- Allows queuing tasks – If your Raspberry Pi can handle it, you can queue a series of tasks to automate them – like testing your code before uploading to a microcontroller, then opening it up for serial communication.
- User accounts and workspaces – If you are sharing your computer with another developer, it can be easier to access your development setup by logging in to your account or opening your “workspace.” The workspace is your setup on the built-in file explorer, which you can save to allow you to access the same setup at a later time.
- Ease of use – Visual Studio Code is easy to use and comes with plenty of keyboard shortcuts.
- Can be terribly slow – This can be both a user-made problem and a comes-with-the-program one. Visual Studio Code takes much longer to open and does so with zero extensions.
- Running other languages can be slow, too – For one, this is mostly a problem with the Raspberry Pi. If you are used to compiling scripts on a proper laptop or computer, you’ll easily notice the compilation time being much slower while running Visual Studio Code on a Rasbperry Pi. This, however, is not much of a big deal with Python, as it is an interpreted language.
- Confusing at first – With all of the personalization options, using it for the first time as a beginner can be a bit confusing. After all, why would you care about syntax and linters when you haven’t even printed your first “Hello World” yet?
What They Have in Common
While Thonny and Visual Studio Code are two separate entities, they have a lot in common when it comes to functionality.