I’ve been working with Python for over a year now and I’ve grown to like the language very much. It’s made its own place in the industry and in academia. It’s also currently the most wanted programming language according to StackOverflow’s 2018 developer survey.
Most people at my workplace prefer to use PyCharm as their primary IDE, which is understandable because it provides a lot of features for Python development and it has a familiar UI. I don’t, though. I prefer to use VS Code as my primary editor and here’s why.
On the other hand, PyCharm is a full-featured IDE developed by JetBrains specifically for Python development. It’s written in Java and Python, and provides many features for Python development out-of-the-box. There’s a catch: only the community edition is free, and the professional edition costs around $200 per year.
Both editors provide a range of features for Python development which every developer needs in their standard toolkit, such as:
Intelligent code completion
Full text search, including support for regexes
Syntax highlighting and bracket matching
Code formatting and autopep8 support
Code linting using pylint
Debugging and code inspection tools
User defined code snippets
But let’s talk about how both of them differ and what should persuade you to pick one over the other. Let the smackdown begin!
Even when running idle, PyCharm consumes around 1 GB of memory on my machine, while VS Code remains under 300 megabytes in almost all cases. VS code consumes significant memory only when I open multiple projects with dozens of files.
In the performance criteria, VS Code easily beats PyCharm. Because VS Code doesn’t try to be a full IDE and keeps it simple as a text-editor, the memory footprint, startup-time, and overall responsiveness of VS Code is much better than PyCharm.
Winner: VS Code
PyCharm is a part of the JetBrains family of IDEs, and all of those IDEs provide extensibility through plugins. Currently, PyCharm has almost 3000 extensions listed on the JetBrains website.
VS Code on the other hand is designed to be a bare-bones editor which can be transformed into a complete IDE using extensions. The entire support for Python (including syntax highlighting, debugging and code completion) is just a single extension. VS Code has an extension for almost everything, and it is very simple for developers to build their own. All these extensions can be found in the VS Code Marketplace. That means VS Code ends up being far more extensible than PyCharm.
Winner: VS Code
PyCharm has a lot of features that most people don’t need regularly (advanced code refactoring tools), and it is slightly confusing figuring out where to find the configuration options if you haven’t used it before.
Configuring VS Code is much easier to wrap your head around. All you have to do is type Ctrl+Shift+P and a command palette appears where you can search for anything you’d like to do, and it will appear in the results.
Winner: VS Code
On the other hand, VS Code is FOSS (Free and Open-Source Software). This is a no-brainer. You can’t beat a price of $0.
Winner: VS Code
PyCharm is a great tool and has a lot of features that can make Python development easier. However almost all the features I use are available in VS Code and the only major feature that isn’t present is remote debugging, which is also under development in VS Code.
That means VS Code gives you almost all of the features in PyCharm at much better performance and (of course) price than PyCharm. PyCharm has its uses in the industry, but I’ll stick to VS Code for my Python work.
It’s only fair to mention that there are things which PyCharm does better. These things include:
Remote debugging: Available only in the professional edition, remote debugging lets developers use tools in the IDE to run and debug code executing on a remote machine over SSH or some other protocol. Most of my work in Python has been on Open edX platform, which requires either VirtualBox or Docker environments. PyCharm already supports debugging inside both. Searching: PyCharm contains advanced text search and replace features that aren’t available in VS Code. One of these features is called “Search Everywhere”, which searches filenames as well as content in the entire project.
Django support: PyCharm Professional Edition offers special support for Django projects, including code completion and resolution in views.py and urls.py files, code inspection tools for Django ORM, and the ability to debug django templates.
Consistent user experience: All of the JetBrains IDEs have a similar UI, keyboard shortcuts, and menus. That makes it easier for developers already using a JetBrains IDE to switch to PyCharm. VS Code follows the traditional editing metaphor but each developer has to setup his/her own configuration for the editor and find and install the plugins which are most suited to their workflow.
Vim emulation: If you’re a fan of Vim style keybindings like I am, then you’ll be happy to know that PyCharm and the JetBrains family of IDEs offer extensive Vim emulation through the use of the IdeaVim plugin. It also supports its own ideavim.rc file. VS Code has options to enable Vim-like editing but the plugin drops the performance significantly and it also does not support vimrc files.
If these features matter to you, PyCharm might still make more sense for you than our smackdown winner — VS Code.